Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support themes in kata previews #1798

Merged
merged 5 commits into from
Jul 29, 2024
Merged

Support themes in kata previews #1798

merged 5 commits into from
Jul 29, 2024

Conversation

billti
Copy link
Member

@billti billti commented Jul 26, 2024

Cleaned up the kata svg images and content to reduce css duplication, updated the katas preview page to support themes (based on OS preference - same as QCOM), and explicitly set the playground to light theme so images render correctly.

Example of theme switch when changing OS preference below.

theme-switch.mp4

@DmitryVasilevsky
Copy link
Contributor

DmitryVasilevsky commented Jul 26, 2024

Is it normal that my preview looks like this:
image
(This is only in the PR, I didn't try using the branch)

Copy link

Benchmark for 96c394f

Click to view benchmark
Test Base PR %
Array append evaluation 339.9±6.35µs 337.0±3.01µs -0.85%
Array literal evaluation 196.9±3.59µs 189.5±1.45µs -3.76%
Array update evaluation 419.1±3.23µs 414.9±3.15µs -1.00%
Core + Standard library compilation 23.2±0.53ms 21.6±0.55ms -6.90%
Deutsch-Jozsa evaluation 5.0±0.21ms 4.9±0.05ms -2.00%
Large file parity evaluation 34.1±0.40ms 34.1±0.67ms 0.00%
Large input file compilation 14.5±0.46ms 13.1±0.36ms -9.66%
Large input file compilation (interpreter) 55.2±2.37ms 53.2±2.39ms -3.62%
Large nested iteration 32.5±0.16ms 32.6±0.69ms +0.31%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1634.8±176.60µs 1565.8±35.24µs -4.22%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.2±0.23ms 7.7±0.10ms -6.10%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1485.9±177.67µs 1461.4±121.02µs -1.65%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 28.7±0.26ms 27.6±0.30ms -3.83%
Teleport evaluation 91.2±3.61µs 90.9±3.08µs -0.33%

@billti
Copy link
Member Author

billti commented Jul 26, 2024

Yes, as the standalone image doesn't have any CSS. The other option is to copy all the CSS into every image, which means to remember to update every image to match if the styles change and also increases file sizes a bit.

@DmitryVasilevsky
Copy link
Contributor

DmitryVasilevsky commented Jul 26, 2024

Somehow that Apply_hadamard image still renders with a little glitch for me on a monitor with lower DPI. The vertical line is almost invisible. I checked SVG source and I'm not sure why this happens. Both left and right edge of this line are coded as vertical lines (V) so the width should be the same...
image

Copy link

Benchmark for 92d0f3d

Click to view benchmark
Test Base PR %
Array append evaluation 336.0±2.05µs 341.5±5.96µs +1.64%
Array literal evaluation 192.8±1.57µs 176.1±2.25µs -8.66%
Array update evaluation 411.2±2.22µs 414.9±4.57µs +0.90%
Core + Standard library compilation 22.8±0.77ms 22.7±0.75ms -0.44%
Deutsch-Jozsa evaluation 4.9±0.05ms 4.9±0.04ms 0.00%
Large file parity evaluation 34.1±0.13ms 34.0±0.11ms -0.29%
Large input file compilation 13.6±0.43ms 13.5±0.88ms -0.74%
Large input file compilation (interpreter) 53.1±1.89ms 53.5±1.97ms +0.75%
Large nested iteration 32.5±0.16ms 33.1±0.70ms +1.85%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1579.4±89.23µs 1585.6±105.81µs +0.39%
Perform Runtime Capabilities Analysis (RCA) on large file sample 7.9±0.15ms 7.9±0.09ms 0.00%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1450.7±145.29µs 1446.1±110.88µs -0.32%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 28.2±0.46ms 27.9±0.30ms -1.06%
Teleport evaluation 91.7±3.13µs 91.7±3.21µs 0.00%

@billti
Copy link
Member Author

billti commented Jul 28, 2024

Updated the way CSS is used to enable easier editing and previewing, and documented this in the readme. (If your OS theme is set to light (or just NOT to dark), the GitHub preview should also look better now).

Copy link

Benchmark for d6d20b7

Click to view benchmark
Test Base PR %
Array append evaluation 338.0±4.37µs 338.9±3.59µs +0.27%
Array literal evaluation 175.4±1.67µs 175.3±3.29µs -0.06%
Array update evaluation 414.6±2.56µs 416.2±2.46µs +0.39%
Core + Standard library compilation 23.1±0.89ms 23.8±1.09ms +3.03%
Deutsch-Jozsa evaluation 4.9±0.05ms 4.9±0.05ms 0.00%
Large file parity evaluation 34.0±0.09ms 34.0±0.37ms 0.00%
Large input file compilation 13.6±0.43ms 13.8±0.54ms +1.47%
Large input file compilation (interpreter) 54.0±2.02ms 54.8±1.70ms +1.48%
Large nested iteration 32.9±0.26ms 32.9±0.17ms 0.00%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1538.9±71.64µs 1589.6±69.41µs +3.29%
Perform Runtime Capabilities Analysis (RCA) on large file sample 7.9±0.10ms 7.9±0.11ms 0.00%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1405.2±70.11µs 1448.3±79.60µs +3.07%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 27.9±0.30ms 28.4±0.37ms +1.79%
Teleport evaluation 90.9±3.09µs 90.6±3.34µs -0.33%

@billti billti added this pull request to the merge queue Jul 29, 2024
Merged via the queue into main with commit 06a5028 Jul 29, 2024
19 checks passed
@billti billti deleted the billti/themes branch July 29, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants