Skip to content

[SPIRV] Track id to variable mapping to be able to use original variable name… - #1097

Open
hernanponcedeleon wants to merge 2 commits into
developmentfrom
idToVars
Open

hernanponcedeleon wants to merge 2 commits into
developmentfrom
idToVars

Conversation

@hernanponcedeleon

@hernanponcedeleon hernanponcedeleon commented Sep 11, 2026

Copy link
Copy Markdown
Owner

This PR adds mappings between SPIRV ids and original variables names. This allows to write the program header (inputs/outputs/specification) in terms of sourcecode variables. One can still used the SPIRV id so there should not be regressions.

I updated the headers in benchmarks/opencl/benchmarks and benchmarks/opencl/patterns so now those can be passed directly as input to dartagnan, e.g.,

dartagnan cat/vulkan.cat --target=vulkan benchmarks/opencl/benchmarks/caslock.cl           
Test: benchmarks/opencl/benchmarks/caslock.cl
Result: PASS
Time: 0.032 secs

Notice I removed many of the // Currently, clspv inserts Coherent decorations only if ... since this has been fixed in google/clspv#1651.

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

Performance comparison

Linux x64

Benchmark details

Memory model: vmm

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/cna.c 11.375 ± 0.552 s 11.478 ± 0.742 s ➖ -0.9% [-11.0%, +9.2%] UNKNOWN
benchmarks/locks/mutex_musl.c 24.854 ± 3.624 s 23.641 ± 2.805 s ➖ +4.6% [-20.2%, +29.4%] UNKNOWN
benchmarks/lfds/dglm.c 19.812 ± 0.668 s 21.147 ± 0.764 s ➖ -6.8% [-39.0%, +25.3%] UNKNOWN
benchmarks/lfds/ms.c 36.524 ± 0.625 s 35.242 ± 1.666 s ➖ +3.5% [-24.5%, +31.5%] UNKNOWN
benchmarks/lfds/treiber.c 10.490 ± 0.296 s 10.241 ± 0.419 s ➖ +2.4% [-7.7%, +12.5%] UNKNOWN
benchmarks/lfds/safe_stack.c 6.444 ± 0.260 s 6.568 ± 0.152 s ➖ -2.0% [-13.6%, +9.6%] UNKNOWN
benchmarks/challenging/cna.c 32.592 ± 2.975 s 29.770 ± 1.086 s ➖ +8.4% [-20.1%, +36.9%] UNKNOWN

Memory model: aarch64

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/linuxrwlock.c 6.093 ± 0.045 s 6.062 ± 0.084 s ➖ +0.5% [-3.6%, +4.6%] UNKNOWN
benchmarks/challenging/cna.c 13.327 ± 1.030 s 12.398 ± 1.428 s ➖ +7.2% [-14.6%, +28.9%] UNKNOWN

Memory model: power

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/linuxrwlock.c 15.195 ± 0.544 s 15.467 ± 0.407 s ➖ -1.8% [-10.5%, +6.9%] UNKNOWN
benchmarks/locks/mutex_musl.c 14.664 ± 1.109 s 13.656 ± 0.178 s ➖ +6.5% [-37.5%, +50.5%] UNKNOWN
benchmarks/lfds/ms.c 26.253 ± 2.310 s 23.903 ± 1.594 s ➖ +8.8% [-15.6%, +33.2%] UNKNOWN
benchmarks/lfds/treiber.c 12.202 ± 0.924 s 12.401 ± 0.629 s ➖ -1.8% [-18.1%, +14.6%] UNKNOWN

Total

Benchmarks Base branch PR branch Improvement (99% CI)
All reported benchmarks 229.824 ± 4.924 s 221.974 ± 6.015 s ➖ +3.4% [-1.3%, +8.1%]

5 benchmark(s) omitted because both averages were below 5 seconds.

macOS ARM64

Benchmark details

Memory model: vmm

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/cna.c 24.123 ± 1.580 s 25.043 ± 1.406 s ➖ -4.0% [-42.3%, +34.3%] UNKNOWN
benchmarks/locks/mutex_musl.c 26.502 ± 0.431 s 28.646 ± 0.123 s ➖ -8.1% [-20.1%, +3.9%] UNKNOWN
benchmarks/lfds/dglm.c 67.333 ± 4.163 s 88.667 ± 10.263 s ➖ -31.4% [-71.6%, +8.8%] UNKNOWN
benchmarks/lfds/ms.c 78.000 ± 15.000 s 87.000 ± 5.000 s ➖ -13.5% [-103.6%, +76.5%] UNKNOWN
benchmarks/lfds/treiber.c 16.770 ± 0.503 s 16.091 ± 0.779 s ➖ +4.1% [-9.8%, +17.9%] UNKNOWN
benchmarks/lfds/safe_stack.c 11.002 ± 0.430 s 11.466 ± 0.888 s ➖ -4.4% [-59.8%, +51.1%] UNKNOWN
benchmarks/challenging/cna.c 50.038 ± 2.586 s 47.023 ± 5.788 s ➖ +6.3% [-34.1%, +46.6%] UNKNOWN

Memory model: aarch64

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/linuxrwlock.c 20.490 ± 1.179 s 19.401 ± 2.194 s ➖ +5.3% [-47.1%, +57.7%] UNKNOWN
benchmarks/locks/mutex_musl.c 13.495 ± 2.651 s 16.133 ± 0.436 s ➖ -22.4% [-149.9%, +105.1%] UNKNOWN
benchmarks/lfds/dglm.c 15.349 ± 4.351 s 17.289 ± 2.714 s ➖ -17.7% [-184.8%, +149.4%] PASS
benchmarks/lfds/ms.c 20.315 ± 1.940 s 18.829 ± 0.718 s ➖ +6.6% [-59.1%, +72.3%] UNKNOWN
benchmarks/challenging/cna.c 34.707 ± 4.679 s 39.564 ± 2.855 s ➖ -16.2% [-158.7%, +126.2%] UNKNOWN
benchmarks/challenging/wsq.c 15.602 ± 1.644 s 14.429 ± 0.554 s ➖ +7.0% [-32.9%, +47.0%] UNKNOWN

Memory model: power

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/linuxrwlock.c 67.604 ± 14.741 s 64.667 ± 4.509 s ➖ +0.3% [-166.5%, +167.1%] UNKNOWN
benchmarks/locks/mutex_musl.c 30.863 ± 6.794 s 32.446 ± 4.154 s ➖ -6.5% [-62.1%, +49.1%] UNKNOWN
benchmarks/lfds/dglm.c 13.989 ± 0.843 s 15.059 ± 1.017 s ➖ -7.7% [-43.3%, +27.8%] UNKNOWN
benchmarks/lfds/ms.c 64.393 ± 7.015 s 64.020 ± 10.405 s ➖ +0.8% [-56.7%, +58.3%] UNKNOWN
benchmarks/lfds/treiber.c 26.331 ± 2.373 s 27.869 ± 2.302 s ➖ -6.2% [-63.3%, +50.9%] UNKNOWN

Total

Benchmarks Base branch PR branch Improvement (99% CI)
All reported benchmarks 596.906 ± 17.535 s 633.640 ± 20.191 s ➖ -6.2% [-35.5%, +23.1%]

@hernanponcedeleon hernanponcedeleon changed the title Track id to variable mapping to be able to use original variable name… [SPIRV] Track id to variable mapping to be able to use original variable name… Sep 13, 2026
@ThomasHaas

Copy link
Copy Markdown
Collaborator

Oh, you found another usage for Metadata. Now I feel like we should create a top-level metadata package with all metadata classes, seeing that with this PR and #1104 we already have 3 different metadata packages that are quite deeply nested.
Alternatively, we could also put Metadata as inner classes of the class they should be associated with, e.g., MemoryObject.VariableName, Program.SourceLocation, and Wmm.CutAnnotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants