Repository navigation
Shaders: path-sensitive reachability for missing values across phi joins (#736) - #1230
Ctrl-Alt-Haze wants to merge 2 commits into
Conversation
|
Setup: Linux, RX 9070 XT, RADV (Mesa 26.3.1), dxil-spirv master, spirv-val 1.3. Your head folded onto a base of origin/main
One program that translated on the base no longer does: a pixel program that now stops at "barycentrics read directly" (2 -> 3 pixel programs). Nothing else moves; worth a look whether your reachability change is meant to reach a barycentric read that the base folded away. Not tested: in-game. |
|
@pablogonz12 Thank you for catching that pixel regression on the 768-program RADV check! Root cause: Pixel shaders begin with Fix (
Re-verified on
AI-assisted fix ( |
|
Rebased onto upstream
Verified locally on Windows 11 x64 / NVIDIA GeForce RTX 5070 Ti + WARP:
|
6f77efd to
6bd5dd9
Compare
|
Retested the cyclic regression fixture from #604/#612 on the rebased head To reproduce, add the test function to the existing tests in |
|
Automated triage for the maintainers. Closing because this change is already in now rebased, it replaces main's #736 fix (live_edges with never_taken/dead_on_edge in fill_phis, a7fc47a) with a 2.2k-line taint fixpoint and removes the never_taken/dead_on_edge use that main's emitted programs rely on; no measurement on the title's list. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Summary
Fixes #736 (
#612regression on phi reachability) while preserving #604 soundness and passing the two-join live descriptor word soundness control.Changes
crates/victory-shader/src/structure.rs:BoolSet<'a>, a non-mutating ROBDD overlay over&'a Bools(and,or,not,forgetfor loop back-edges,edgeforreach[q] & exits[q],sat, bounded atMAX_OVERLAY_NODES = 65536with conservativeBool::TRUEfallback on overflow).crates/victory-shader/src/emit/lower.rs:read_phistransitive closure + globalbad/Stop::Retrypoisoning with single-pass path-sensitive missing-value taint tracking (ReadDep,ValueDeps,SinkRead,check_missing_reach) solved to a bounded fixpoint (MAX_TAINT_ROUNDS = 256with conservativeBool::TRUEwidening) infill_phis.Lower::get(get_inner) somask_dword(mask_ok && is_mask) does not falsely treatEXECphis/predecessors as data reads.oldfallbacks inold_i32_ofwith lane-conditionedOldDep/direct_missingtracking (!guardforwrite_placedanddsatomicoutsidewhen guarded with a destination register; active lanes forplace_bits,write_16(keep), andlow_halfwhile exempting onlyv_interp_p1lv_f16accumulator reads), and routedfloat_src/v_fmac_f32/self.floatscache hits throughrecord_readso live missing values never silently drop.lower::tests: preserveda_missing_value_stays_missing_through_two_live_joins(Shader emitter accepts an unsupported timestamp read after two SSA joins #604), added the two-join live structured-buffer descriptor-word control (a_live_descriptor_word_stays_missing_through_two_joins),old_register_missing_values_and_cached_floats_stay_refused,unknown_stride_load_stays_missing_when_live_and_lowers_when_overwritten,first_half_of_interpolation_stays_missing_when_live_and_lowers_when_overwritten,guarded_write_and_exec_mask_phi_lower_soundly, andloop_missing_value_refuses_on_back_edge_and_lowers_when_infeasible.crates/victory-shader/src/emit/valu_tests.rs:reachability_overwritten_missing_phis_match_on_host_and_warpexecuting correlated-overwrite descriptor-word, unknown-stridebuffer_load_dword, and loop-invariants_memtimeshaders withdxil.dllvalidation on RTX 5070 Ti + WARP.Verification
32.0.16.2135), WARP (VICTORY_WARP=1), Windows SDK10.0.26100.0dxil.dll, Rust1.98.1, baseffe310eb.cargo xtask policy:154 files okcargo clippy --workspace --all-targets --locked -- -D warnings(default &--all-features): passedcargo test --workspace --locked:349 passed, 0 failed, 6 ignored(victory-shader127/1 ign)cargo test -p victory-shader --features host --locked(RTX 5070 Ti + WARP):127 passed, 0 failed, 1 ignoredVICTORY_WARP=1 cargo test -p victory-shader --features host --locked(WARP):127 passed, 0 failed, 1 ignoredcargo test -p victory-gpu --features diagnostics --locked&VICTORY_D3D12_WARP=1:53 passed, 0 failed, 1 ignoredeachrustfmt --edition 2024 --checkon modified files: zero diffs on added/modified lines (valu_tests.rscompletely clean).AI use: Written and verified locally with an AI coding swarm (
gemini-4-hydrogen-high), then independently audited and tested on RTX 5070 Ti + WARP.