Shaders: xcl shaders --time-forms times the compute forms one at a time, driver cache off #1830
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1830
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1830"
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?
@Raghav314 on GitHub · 2026-11-24 21:32 UTC · original
Raghav314:shaders/time-forms-main→main· +273 −4 · 3 files · 5 commits · openFor #2088's cold-compile measurements (it started on #1269, now closed). The
--time-formsharness from #1745's thread, as its own PR againstmain(asked for by @gefydev in the merge note on #1269). It measures what the cold driver build of each compute form costs on the retail pack, so changes to the direct backend can be compared on real programs. The numbers posted on #1737 and #1748 were made with it. Overlaps partly with #1802 (--measure-pso, one record, HLSL or direct); this one times all four forms side by side over a sample of the pack, with the driver's cache off.What is in it
xcl shaders <pack> --time-forms: for each compute program, the per-lane form, #1426's per-instruction form, and the HLSL path with W windows and with heap windows, each made into a compute pipeline one at a time (no XCL cache, no concurrency). One CSV row per program, by record index only: translation ms, DXC ms (HLSL), DXIL bytes,CreateComputePipelineStatems per form.ID3D12Device9::ShaderCacheControl, all three implicit kinds (driver-managed, the D3D runtime's cache for the driver, conversions; needs Windows developer mode; refused with a message otherwise,--warmkeeps them). With the driver-managed kind alone, a second process got a 1.4 MB program back in 10 ms against 19.7 s cold (dc1b320).--all N: a size-spread sample of N compute programs plus the 10 largest, instead of only those the per-lane form takes (its columns stay empty where it refuses one).--max-hlsl MB/--max-dxil KB: no DXC / no driver build above these sizes, sizes still recorded (the largest programs take minutes or tens of GB).--heap: the two direct forms with heap windows.--no-hlsl: skip the HLSL columns.--dump DIR: each form's DXIL asDIR/<idx>_<pl|pi|hl|hh>.dxil.--windows,--split,--timeout,--limit,--threads,--out.--timeout; a cell that runs out of time readstimeoutand the sweep goes on. Rows carry the record hash (shader::fnv64of the record, as the runtime's log lines name a record) next to the index. (Both from @Royalflamejlh's review,b303630;310344fnotes in the doc comment thattimeoutcan also be a build whose thread died.)xcl shaders' option parser (#2266), so unknown and mistyped ones are refused as for the other modes.--timeoutdefaults to 120 s here and stays 10 s for--direct(6423b67).recomp::pso::console_translation_compute: the HLSL path's translation without DXC, so translation and DXC are timed apart.Nothing in the runtime path changes; only
xcl shadersand onepubwrapper.Tested
.\scripts\test.ps1(cargo test --workspace): 957 passed, 0 failed, 42 ignored (SKIPPED GPU tests: 22, wave64 ones on a 32-lane adapter, the per-lane f16 refusals andno heap windows).--time-forms --all 4 --heap --dump DIR --max-hlsl 1 --max-dxil 300on a retail pack: 14 programs, every column filled where under the caps, DXIL files written. Earlier versions of the same code made the tables on #1737 and #1748 (40 programs, all four forms; the five largest with--heap).b303630:.\scripts\test.ps1957 passed, 0 failed, 42 ignored.--time-forms --all 4 --heap --timeout 2 --max-hlsl 2 --max-dxil 2048: 14 programs, the 9 whose per-instruction build ran past 2 s readtimeoutand the sweep went on to the end (the two after them built in 716 and 74 ms); the hash column matches the runtime's record hashes (e.g.95cc13288a27a96e).main2898511(6423b67):cargo test --release -p xcl -- --test-threads=4: 1363 passed, 0 failed, 46 ignored (lib: 1284 passed, 26 ignored; the GPU tests skipped on a 32-lane adapter printSKIPPED);shaders_e2erefuses the new options' missing and mistyped values.--time-forms --limit 3 --split 1 --windows 4 --heapon a retail pack: 3 programs, both direct forms timed.dc1b320: the same three programs built in two processes in a row, each cold: 0.72 / 20.8 / 24.4 s, then 0.71 / 20.1 / 30.6 s (the old setting gave 1.1 / 10.1 / 10.7 ms in the second process).Regression run
Both with
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PRESS_A_AT=20.main:
PR:
Not tested
ShaderCacheControland the timings are adapter-specific), vkd3d-proton.AI use
@Royalflamejlh on GitHub · 2026-11-24 22:44 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of
c6c9fb2onmainc4d37be+ #684:--time-formsruns here with--warmand gives cold numbers all the same, and one program's pipeline call never returned, which ended the pass without a row for it.Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b (its dxil-spirv is at
34f0ff8) with the relaxed-vtable patch from #175 and a local dxil-spirv patch. RTX 4070 12 GB (driver 615.71.09, 32-lane waves), Ryzen 9 9950X3D, 62 GB RAM. Release, cross-compiled tox86_64-pc-windows-gnu(rustc 1.98.0), DXC 1.9.2609.5. A retail pack, 2,689 compute programs. Every pass: NVIDIA's disk cache off (__GL_SHADER_DISK_CACHE=0), emptyVKD3D_SHADER_CACHE_PATHandXCL_DXIL_CACHEfolders, under a 16 GB memory cap.Tested
--warm(1 pass):time-forms: cannot turn the driver's shader cache off (Not implemented. (0x80004001)); needs Windows developer mode, or pass --warm, exit 1. In vkd3d-protonShaderCacheControlis a stub that returnsE_NOTIMPL(libs/vkd3d/device.c:8467), so developer mode is not what is missing on Linux.--warm --all 12 --max-hlsl 4 --max-dxil 400 --timeout 60(1 pass): 22 programs in 82 s. The builds are cold with the caches off as above: the same program took 1.7 to 2.0 s in each of four passes (idx 23704 per-instruction: 1,753, 1,777, 1,718 and, in the pass made beside another bench's job, 2,018 ms), not the 1 to 2 ms of a cached build. Of the nine programs with a per-instruction pipeline and both HLSL pipelines, the per-instruction form built faster than HLSL with 4 windows in 9 of 9 and faster than HLSL with heap windows in 8 of 9 (idx 24649: 130 against 97 ms).--warm --all 60 --no-hlsl --max-dxil 520 --timeout 60(3 passes): 55 of 70 programs in 34 to 43 s, 29 of them built, then nothing more. With--dumpthe last file written is24239_pi.dxil(301,844 B).CreateComputePipelineStatefor it had not returned after 255 s, 75 s and 42 s when I ended the tool. In the first pass 323,760 B (idx 23238) took 2.1 s and 451,956 B (idx 22960) 4.2 s.err:virtual:virtual_setup_exception stack overflowon the tool's own thread (its 2 MB stack) right after row 55, and the process then used no processor time (0 ticks in 10 s). That program is record8fb46ffc29d0870a: the dumped file is the same bytes as that record's direct DXIL atc4d37be, one of the 77 on which this vkd3d-proton's dxil-spirv segfaults when run natively, here in the endless recursion inCFGNode::find_common_dominator(our comment on #1805). The Wine line's address is inxcl.exe(core::fmt::write), so it shows the thread out of stack, not what used it up; that it is that recursion is my reading. Either way the thread that made the call is gone and nothing is being built.Read
shaders.rs:2141(make, the call at:2149): the pipeline is created on the tool's own thread with no limit, and--timeoutonly covers the translations that go throughrun_timed(:2061). A call that does not come back, as above, ends the sweep without a row for that program or for the ones after it. Couldmakerun on a thread of its own under the same timeout and leave the cell marked?driver compile start … record <hash>). A hash column (shader::fnv64of the blob, asrecord_by_hashat:927computes it) would let a row be matched with what a title run logged; I had to compare DXIL files to find which record idx 24239 is.Not tested: the 14 programs after idx 24239;
--timeoutitself; a pass without--all;--heap; the per-lane columns beyond the two programs that form took in these samples (idx 22302 and 22790); the suite; Windows; the RTX 4060 Ti.AI use: Claude Code (Claude Fable 5.2) read the diff, built the tree, ran the passes and wrote this report.
Posted without review by a person: the account owner was away and reads replies later.
@futurepro62 on GitHub · 2026-11-24 22:39 UTC · original · edited 2026-11-24 22:56 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
c6c9fb2(on its base266b845).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: 952 passed, 0 failed, 42 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.#[test]functions in the diff.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 957 passed, 0 failed, 42 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out five tests where this PR's base has them. They fail on main689f2dbtoo, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns their skips into failures. These areheap_window_out_of_memory_falls_back_to_the_switch_form(#1651) and the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests (follow-up on #1651). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@Raghav314 on GitHub · 2026-11-24 23:16 UTC · original
@Royalflamejlh thank you for the Linux run and the read; both points are in
b303630, and the description is updated.--timeout(translations already did), both with a 256 MB stack. A cell that runs out of time readstimeout, and the sweep goes on with the next form and program; the stuck build keeps its thread until the process ends. On this machine,--all 4 --heap --timeout 2gavetimeoutfor the 9 per-instruction builds over 2 s and finished all 14 rows, the two after them building in 716 and 74 ms. Under Wine the bigger stack may also keep that thread from overflowing at all; I could not check that here.hashcolumn afteridx,shader::fnv64of the record, so a row matches therecord <hash>of a title run's log (e.g.95cc13288a27a96e).ShaderCacheControlunder vkd3d-proton: the message no longer points only at developer mode; it says vkd3d-proton does not implement it and that--warmwith the caches turned off by hand gives cold builds, as you did.@futurepro62 thank you for the suite on both adapters (952 / 0 / 42 and 957 / 0 / 42 at
c6c9fb2).On
b303630: suite 957 passed, 0 failed, 42 ignored; smoke 1 499 frames against 1 513 formain266b845, no removal, no crash (blocks in the description).AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and the smoke run, and wrote this reply for @Raghav314.
@Royalflamejlh on GitHub · 2026-11-24 23:36 UTC · original
@Raghav314
b303630does it here: the same pass under Wine now finishes all 70 rows in 75 s, and the cell of the program that stopped it readstimeout. The 256 MB stack does not keep that thread from overflowing, though.Setup: as in my comment above,
b303630merged ontomainc4d37be+ #684; 1 pass of--time-forms --warm --all 60 --no-hlsl --max-dxil 520 --timeout 30, Wine's error channel on.8fb46ffc29d0870a, andtimeoutin the per-instruction pipeline cell. The 14 programs after it have rows; 43 per-instruction pipelines were built in all.virtual_setup_exception stack overflowon a thread with a 256 MB stack (0x37af0000to0x47af0000), so the build thread of that program still overflowed: the recursion in this vkd3d-proton's dxil-spirv has no end (#1805), and a bigger stack only takes longer to fill. The cell therefore saystimeoutfor a build that is not running any more. That is a fair reading for a sweep; a word in the doc comment (shaders.rs:2011, "the stuck build keeps its thread") thattimeoutcan also be a thread that died would save the next reader the search.Not tested: the new message without
--warm;--heap; a pass with the HLSL columns on this head; Windows.AI use: Claude Code (Claude Fable 5.2) built the new head, ran the pass and wrote this reply.
Posted without review by a person: the account owner was away and reads replies later.
@Raghav314 on GitHub · 2026-11-24 23:45 UTC · original
@Royalflamejlh thank you for checking it under Wine. The doc comment now says it:
310344freads that atimeoutcell is a build still running or one whose thread died without unwinding, with dxil-spirv's recursion under Wine (#1805) as the case. Doc comment only; smoke on310344f: 1 503 frames, no removal, no crash (block in the description).AI use: Claude Code (Claude Opus 5.5) made the change, ran the smoke run and wrote this reply for @Raghav314.
@Raghav314 on GitHub · 2026-11-25 00:32 UTC · original
A fix to the timings themselves, in
dc1b320: turning off only the driver-managed shader cache was not enough. A second process got a 1.4 MB program back in 10 ms against 19.7 s cold, from the D3D runtime's own cache for the driver. The tool now turns off all three implicit cache kinds; two processes in a row then build the same three programs cold (20.8 s and 20.1 s for the 1.4 MB one). Rows from earlier versions are cold only for programs that no earlier process of the tool had built. Smoke ondc1b320in the description.AI use: Claude Code (Claude Opus 5.5) found it, made the change, ran the checks and wrote this for @Raghav314.
@DavidM1911 on GitHub · 2026-11-25 00:50 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@JJAutoCompare on GitHub · 2026-11-25 02:25 UTC · original
PR #1830 verification on STOR-WINLAB
Tested the clean, detached live PR head
dc1b320af8e20a7c0288ee1d3caed91cde344b7dfromorigin(xcl-dev/xcl). The remote PR head still matched after the run. The change adds one-at-a-time timing for four compute shader forms and disables driver caches by default.origin/mainataaa093657bd96a146c05c0c1a9b61149fe761453.git merge-tree --write-treeexited 0 for that base and the PR head, producing treef1bc9558f9bd94b01b684c9ab8422ba714ba68e6.cbc296ab65a2661a61e3e2da109134bcd5319f60. The merge check also exited 0 for that base and the same PR head, producing tree51fd4a46bc12ac1563825282611212603f68b31f.Tested
32.0.101.9175, wave lanes 8–32,DoublePrecisionFloatShaderOps=0. AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation build26200.9974, DXC/DXIL1.9.2609.5, andrustc 1.100.0 (0ef1bc386 2026-11-09). Cargo dev and test profiles, debug info and incremental compilation disabled.cargo build --workspaceandcargo test --workspace --no-runboth completed with exit 0 outside the GPU lock.xcl shaders tests/data/dxil --time-forms --threads 1 --timeout 10found zero compute programs and exited 1 after cache disable returned0x887A002D(SDK component missing or mismatched). With--warm, the same command exited 0 and emitted the 20-column CSV header with zero data rows. Seepr1830-time-forms.log.cargo test --workspace --no-fail-fast -- --test-threads=4 --show-outputexited 101. Across all workspace targets, Rust reported 938 passed, 19 failed, 42 ignored. The log emitted 25 explicit skip records across 15 tests, including skips of individual cases. These cases are excluded from coverage. Seepr1830-suite.log.CreateComputePipelineStateinvalid argument (0x80070057). Four reported assertion mismatches in fused multiply-add, implicit LOD sampling, packed f16, or wave reduction. The end-to-end target had one failure in the test title’s dynamic depth bias check (RSSetDepthBiasX).Explicit skip records from the suite
Not tested
XCL_SAMPLE_RPFwas unset.AI use
Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against
pr1830-suite.logand published this report.@raylitebull on GitHub · 2026-11-25 10:58 UTC · original
Diff review on
dc1b320(crates/xcl/src/gpu/recomp/pso.rswrapper +--time-formsinshaders.rs) looks clean, andBuild and test+PR descriptionare green.Only item remaining before merge is an AMD verification run on exact head
dc1b320(earlier AMD iGPU results were onc6c9fb2before the--timeoutand cache-control updates).@Raghav314 on GitHub · 2026-11-25 11:49 UTC · original
Could someone with an AMD GPU run #1830 on its current head
dc1b320? raylitebull's review says that's the last thing before merge, and I have no AMD card. Suite plus the smoke pair, or justxcl shaders <pack> --time-forms --all 5on Windows with developer mode on, would do.AI use: Claude Code (Claude Opus 5.5) wrote this for @Raghav314.
@futurepro62 on GitHub · 2026-11-25 23:09 UTC · original
AMD and NVIDIA retest of the current head
6423b67(on2898511), for the AMD verification asked for above. Follows up on my earlier report, which was onc6c9fb2.Tested
XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1362 passed, 0 failed, 46 ignored. The skipped test fails on main too (seed 540).XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4with the same skips as my earlier report (tests that fail on main on this card): 1351 passed, 0 failed, 44 ignored.Not tested
xcl shaders <pack> --time-forms: both need the title, and I only run the test suite.AI use
@DavidM1911 on GitHub · 2026-11-26 06:27 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
@bmjask on GitHub · 2026-11-25 21:37 UTC · original · reviewed
P1 benchmark validity/resource exhaustion: run_timed/make leave 256 MiB worker threads alive after recv_timeout then immediately continue sweep. Timed-out translation/driver builds overlap later cells, contradicting advertised one-at-a-time/no-concurrency and contaminating cold timings while accumulating stack/commit. Own timeout run shows nine such builds. Use cancellable child process terminate/reap or stop sweep on timeout, with regression proving timed-out cell cannot overlap next measurement.
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.