tooling: isolate the DXC GVN cost to conditional UAV stores #911
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/918"
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 R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-23T17:09:11Z.
Refs #775. This advances the #676 replay-profile compile-time investigation and touches one interface:
tools/dxc_compile_time.pyplus the new compile-only CTestdxc_compile_time_gvn.What this isolates
Reducing the merged
samplebranch_Nfamily one element at a time shows the GVN cost needs no sampler. Removing the samples, the else arm, the staticgl_WorkGroupIDreads or the shared condition operand left the superlinear growth in place. Making the stores unconditional removed it. The minimal pair, added to the tool:condstore_N: Nif (((gl_WorkGroupID.x + k) & 1u) != 0u) _4.Store(...)into the raw UAV, with no sampling beyond the fixture's two control stores.stores_N: the same source without theifwrappers. The test checks that this is the only difference.-print-before gvn(DXC 1.9) shows each conditional block re-creating the UAV handle (createHandleForLib+annotateHandle), with no memory operations in the join blocks between them. A plausible mechanism is a non-local memory-dependence walk per handle call over all earlier joins, with cached results, which would be quadratic in time and memory. That mechanism is a hypothesis about DXC internals. The measured facts are below.The tool also now accepts the three-column
-ftime-reporttable that LLVM prints when no pass records system time. Without that, small variants reported no passes (the issue raised in the #801 review). The existing variant sizes are unchanged (--list-variants).Measurements (compiler only, no PSO or dispatch)
Ryzen 7 3700X (8C/16T, 32 GiB), Windows 10 build 19045, one compile at a time,
-T cs_6_6 -E main -enable-16bit-types. The DXC builds are 1.7.2308.16 (52da17e29, Windows SDK 10.0.26100) and 1.9.0.5512 (01b62ad47, LunarG Vulkan SDK 1.4.363.0). The maintainer's 1.8.2502.11 build was not available on this machine.-opt-disable gvnThe rows up to
condstore_4096are medians of three runs; the others are single runs. In-ftime-reportforcondstore_4096, GVN takes 93.1 % of pass time on 1.7 and 95.3 % on 1.9.stores_4096has no GVN among its top two passes. The policy timeout falls at 0.86-1.73 MB here, against 2.9-3.9 MB forsamplebranch_N. The independent rerun of the mergedsamplebranchvariants on both builds is indocs/experiments.md.-opt-disable gvnthere bringssamplebranch_16384to 18-28 s.-opt-disable gvnis a labelled diagnostic setting only. Its DXIL is not GPU-checked and it is not proposed as a replay flag. This does not attribute the archive cohort: theloop-rotate/Jump Threading archive profile is different.Test
dxc_compile_time_gvn(TIMEOUT 300, SKIP_RETURN_CODE 77) has no wall-time threshold. It checks:condstore_256andstores_256;timeoutand an invalid profilecs_9_9asdiagnostic;condstore_1024, below 25 % forstores_1024, and absent under-opt-disable gvn.If a future DXC loses the GVN profile, the test exits 77 instead of failing. Test-only negative controls, run by hand: putting the old 4-column regex back fails the parser check, and changing the condstore condition fails the source-shape check.
Commands and results (commit
47be65f, rebased onda9bc9c)Both presets built and tested at
ae65994on the previous base. After rebasing ontoda9bc9c(clean merge, no conflicts), the fast checks above andtests/dxc_compile_time_check.pywere rerun. The full dev/release builds were not repeated on the final commit. No capability skips were seen. The configured CTest DXC is 1.7.2308.16.🤖 Generated with Claude Code