Repository navigation
Conversation
…v#1805) Part of xcl-dev#1805. Assisted-by: Antigravity (Gemini 4 Hydrogen)
|
Independent bounded-stack tests on Proton / Wine I ran the two published 2 MiB stack cases individually on base
Both base runs logged Tested
These results cover the synthetic compiler tests on this PR. The retail replay was made with #759 to reproduce the worker loss separately. Retail reproduction on #1805 AI use — OpenAI Codex (GPT-6, exact variant unavailable) ran the tests, checked the logs, and drafted this report. |
…to ethans-superbuild dxil/kernel.rs: its test module follows geom_init. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
A note from #1805's reporter: the AI use
|
There was a problem hiding this comment.
[P2] Excessive dependency walker memory allocation
At line 868, each pending load copies the full store list for its pointer root. A 1,024-step pixel shader retained 1,050,625 copied entries.
Borrowing the list preserved traversal depth and byte-identical DXIL while reducing median additional peak commit inside compute_deps from 16.621 to 0.727 MiB across seven release runs.
Please keep a cursor into the shared list and add a regression test for live child storage.
AI-assisted validation by Codex (GPT-6).
Independent follow-up
Reviewed commit c2b1029c224fa279aa83323bf5b42a3684ba5c04.
On a 1,024-step synthetic pixel shader, seven paired release runs measured median additional peak process commit inside compute_deps of 16.691 MiB with the copying walk (16.617–16.703 MiB) and 0.723 MiB with a borrowed list (0.715–0.789 MiB). Frame-array capacity stayed at 393,216 bytes. Live child-vector capacity fell from 16,891,936 to 131,136 bytes, with 1,050,625 store entries copied versus zero. All 14 translations had the same DXIL SHA-256, abd199f5003ece1b194be93660c8a0b84a63981e55a9c42e9ad9392fb1903fc9. The readout brackets the dependency pass and excludes subsequent DXC work.
The normal review build gave 16.531 MiB median against 0.832 MiB for #1844 at 71f2ceb. Both heads passed the 4,000-join shader on a 2 MiB stack and all 24 seeded GPU draws per head. The stack improvement and child-storage regression can be addressed independently. In crates/xcl/src/gpu/dxil/graphics.rs:868, keep a cursor over the shared store list and add a test that bounds live child storage while preserving the DXIL.
Windows 11 x64, Ryzen 7 5800X, GeForce RTX 3080 (616.92), Rust 1.100.0 MSVC and DXC 1.9.2602.17. No runtime skips in those draw trials. Measurements are process commit deltas and instrumented capacities on a synthetic workload. Retail performance was not measured.
AI assistance: OpenAI Codex (GPT-6) inspected the implementation, analyzed the synthetic test evidence and drafted this review.
Avoid cloning the per-root store list into every live DepFrame in eval_dep by borrowing the shared slice with a usize cursor, preventing quadratic child storage on deep load/store chains. Assisted-by: Antigravity (Gemini 4 Hydrogen)
|
Two contributors checked independently and found that #1844 solves the same problem (for #1805) in a different way: #1607, group D70. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
# Conflicts: # crates/xcl/src/gpu/dxil/graphics.rs # crates/xcl/src/gpu/dxil/kernel.rs
…compact argument Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Convert
Ssa::readand sibling CFG/dependency walkers incrates/xcl/src/gpu/dxil/from call-stack recursion to explicit heap-allocated worklists/loops so large shaders with long chains of join blocks or memory dependencies do not overflow bounded thread stacks. This is bounded-stack hardening motivated by #1805 (the retail crash reported in #1805 was separately traced todxil-spirvin #1860, so this PR does not claim to fix #1805).What is in it
crates/xcl/src/gpu/dxil/ssa.rs: convertSsa::readfrom call-stack recursion to an explicit heap-allocated frame stack (Vec), preserving single-predecessor chain caching, loop-phivisitingmarkers, operand ordering, and trivial-phi elimination; add bounded-stack (2 MiB) synthetic tests for 4,000 sequential if/else diamonds and 3,000 region joins with a loop phi.crates/xcl/src/gpu/dxil/kernel.rs: add a bounded-stack (2 MiB) full direct-DXIL compile test (deep_branch_chain_compiles_on_bounded_stack) with 4,000 sequential conditional branches.crates/xcl/src/gpu/dxil/graphics.rs,crates/xcl/src/gpu/dxil/graphics_tests.rs: convert mutually recursiveblock_deps/value_depsincompute_depsto an explicit heap-allocated stack (eval_dep), borrow shared store lists and call arguments via ausizeslice cursor (DepChildren::Values) instead of copying store lists into every liveDepFrame, and add bounded-stack (2 MiB) synthetic tests for a 4,000-phi dependency chain and a 1,024-step shared-root load/store chain asserting linear live child storage (peak_live_children).crates/xcl/src/gpu/dxil/module/opt.rs: replace tail recursion inis_const_global_ptrwith a loop.Tested
32.0.15.9144), AMD Ryzen 5 7500F 6-Core Processor, Windows10.0.26200.0,rustc 1.100.0 (0ef1bc386 2026-11-09), debug (cargo test) & release (cargo build --release -p xcl).cargo test -p xcl --lib gpu::dxil -- --test-threads=4: 89 passed, 0 failed, 1 ignored (dump_dxc_lowering).cargo test -p xcl --test '*' -- --test-threads=4: 49 passed, 0 failed, 20 ignored (SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).cargo build --release -p xcl: built cleanly with 0 new warnings.Regression run
main:
PR:
Not tested
no wave64on RTX 3060).heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).cargo test --workspaceand non-gpu::dxil--libunit tests were not rerun after83af903(rancargo test -p xcl --lib gpu::dxil -- --test-threads=4andcargo test -p xcl --test '*' -- --test-threads=4).AI use
Ssa::read,compute_deps, andis_const_global_ptrto iterative implementations, refactoredcompute_depsload/call traversal to borrow slices with ausizecursor, added the bounded-stack and shared-root load/store regression tests, ran the test suites and smoke check, and drafted this PR description.