Scripts: run the compile-time benchmark and compare two runs (#1269) #2096
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2106"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by BetterJdue on 2026-11-25T04:25:44Z.
Stacked on #2100 (itself stacked on #1763); only the top three commits belong here:
dae9b63,7d3f7f6,61dd6dc.A script to run the compile-time benchmark of #2100 and one to compare two runs, plus a set of only the large programs and a summary ranked by DXC time, so the slow tail shows next to the median. Scripts and tests only: nothing in
crates/xcl/src. 6 files changed, 431 insertions(+), 12 deletions(-), a little over the 400-line target; the large set (7d3f7f6) can go to a PR of its own if that is preferred.Part of #1269
What is in it
scripts/compile_bench.ps1(dae9b63): builds release and runs the benchmark one compile at a time (-Set full|large|small,-Reps,-DxcArgs); writes the JSON, CSV and log totarget\compile_bench\<commit>and warns when the tree has uncommitted changes.scripts/compile_bench_compare.pyand its test (dae9b63,61dd6dc): compares two runs program by program (sizes, median DXC time, head / base ratio, geometric mean), says when the two environments make the times incomparable, and marks any size change and any time change beyond the run-to-run noise (5 % unless--noisesays otherwise).crates/xcl/tests/compile_bench/measure.rs,main.rs(7d3f7f6):XCL_COMPILE_BENCH=large, 18 programs (base, divergent and resource programs at 8 000, 20 000 and 40 000 operations, native wave64 with 1 memory window and split wave64 with 4); every run prints the programs slowest first and a summary (median, nearest-rank p90, maximum, total, the slowest tenth's share), which also goes into the JSON.README.md: a paragraph under the tests.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on61dd6dc(debug): 764 passed, 3 failed, 41 ignored. The failures are not from this PR:placed_title_textures_share_vram_and_preserve_pixels,transitions_apply_when_their_list_is_submitted,d32s8_targets_take_their_own_size_of_video_memory, the same RDNA2 texture failure and its two lock-poisoning followers as in #2100. SKIPPED: none.compile_benchtests in that run: 16 passed, 0 failed.python -I -m unittest discover -s scripts -p "test_compile_bench_compare.py": 8 tests, OK.1297b3d's copy of these files, which is the same code) and three to the comparison (the noise ignored, the size check dropped,--noisenot passed on) each make a test fail.compile_bench.ps1 -Set large, release, 3 compiles per program, on1297b3d: the same benchmark code asdae9b63and7d3f7f6, but on a newermain(4178e88) whose recompiler emits different HLSL than this PR's base, so these numbers show the shape of the tail, not this head's values: 18 programs, DXC median 24.8 s, p90 155.6 s, maximum 497.5 s (divergent-40000-split-4win: 26.6 MB of HLSL, 33.3 MB of DXIL); the 2 slowest take 47 % of the 1385 s.compile_bench.ps1 -Set small(6 programs of 0.1 to 0.25 s) 5 times on7d3f7f6, the programs' median DXC times moved by at most 1.9 %; within one full-set run (ae43075,3df53eb) the 3 compiles of a program spread by 2.8 and 1.4 % (median), single compiles by up to 17 %. 5 % is a margin chosen above that, not a measured bound.Not tested
scripts/smoke.ps1: none used; scripts and tests only.AI use
upstream-sync referenced this pull request2026-11-25 06:04:27 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T06:02:43Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
upstream-sync referenced this pull request2026-11-25 08:08:13 +00:00
upstream-sync referenced this pull request2026-11-25 11:07:09 +00:00
Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-25T11:43:07Z.
Tested
61dd6dcfe80e40dda56573876cc71612949b8a2aon Windows 11 24H2 (26100.9711), i7-13700, Python 3.14.3.Tested
python -B -m unittest discover -s scripts -p test_compile_bench_compare.pypassed all 8 tests (0 failures, 0 skips).scripts/compile_bench_compare.py, I compared two synthetic JSON reports for the same program on an identical recorded environment. Changing only the head row'sdxc_argsfrom-O1to-O3produced byte-identical text. Changing its synthetic median from 10 ms to 5 ms then printedDXC time 0.500without a settings note. Changing the profile from release to debug did produce a note. The timing values are fixture inputs.Not tested
DXC compilation, actual shader performance, Rust/GPU workspace tests or retail data.
AI use
OpenAI Codex (GPT-6) ran the tests, wrote the synthetic comparison and follow-up patch, and prepared this report.
Follow-up on the review at
61dd6dcfe80e. Tested candidate 6c7bfd018. The existing Rust benchmark prints a completion line after both report writes succeed. The wrapper now checks the current invocation’s captured output for that line and verifies that the JSON exists. On Windows PowerShell 5.1 and PowerShell 7 the original wrapper returned 0 on a skipped rerun with an old report. The candidate returned 1 and preserved those bytes. A run that wrote new artifacts returned 0, and Cargo status 37 propagated. I used a native command stand-in with real Cargo excluded from the child PATH. All 18 script tests passed.Command on the candidate:
python -B -m unittest discover -s scripts -p "test_*.py". Windows 11 build 26100, Core i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) prepared the patch and ran the tests with synthetic inputs. I did not run the full Rust/GPU suite.upstream-sync referenced this pull request2026-11-25 16:10:51 +00:00
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T09:59:20Z.
Review: COMMENTED
On
61dd6dc, the wrapper treats mere existence ofcompile_bench.jsonin its commit-named output directory as proof that this run produced a report. A rerun can reuse that directory. I reproduced a successful-but-skipped stand-in Cargo run that printedtest skipped: no DXCand emitted no JSON: with a previouscompile_bench.jsonseeded in the output directory, the script exited 0 and left the stale report untouched; with the same stub and no seeded file, it exited 1 with the no-report warning. A downstream comparison can therefore label old measurements as the current run.Could each invocation write into a fresh staging directory and publish only newly emitted artifacts (or otherwise prove the report was produced by this run)? A CPU-only fixture with a preexisting report and a successful no-output test stub should still fail while preserving the old artifact. This is an exact-head PowerShell differential; I did not run DXC or a GPU benchmark.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:33:58Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:23:43Z.
Triage (#1607) – head
61dd6dcStacked on #2100 (itself on #1763); only
dae9b63,7d3f7f6and61dd6dcbelong here (compile_bench.ps1, compile_bench_compare.py and its test, the large set and the summary). The shared lines with #2100 and #1763 are the stack, not a duplicate.No problems found in the diff. It conflicts with main and is over the 400-line target, as its description says.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.