Shaders: guard conditional exports #655
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/655"
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 Marvisak/VIctory. Originally posted by Halfect on 2026-11-24T06:16:08Z.
What
Non-final exports under an EXEC mask now use the existing guarded-block lowering, so disabled lanes do not overwrite their previous output. The final pixel
doneexport keeps its existingdiscardbehavior, and mesh exports are unchanged.Adds a synthetic pixel regression that narrows EXEC around a non-final MRT0 export. The old lowering rejects it with
a conditional export; the new lowering emits DXIL that passes the validator.Offline title measurement
Compared 25,889 matched program labels from the local shader archive with
translate --validate --list --jobs 4:a conditional exportblockers are gone.A local compatibility run combined with #621 also removed all eight blockers with no validation regressions. This branch itself is based directly on main and does not include #621.
Checks
cargo test --locked -p victory-shader --lib -- --test-threads=1: 70 passed, 0 failed.cargo clippy --locked -p victory-shader --lib --tests -- -D warnings: clean.cargo xtask policy: 151 files ok.Offline translation and DXIL validation only; no title executable or world run, and no shader contents or extracted data included. AI-assisted (Kimi).
Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:19:45Z.
Review: APPROVED
Tested on native Windows 11 with Rust 1.98.1 (x86_64-pc-windows-msvc).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T09:37:37Z.
Review: APPROVED
Merges cleanly with main; macOS arm64, rustc 1.98.1,
cargo test -p victory-shader --lockedwith the PR merged into main8e79c80→ 71 passed / 0 failed / 1 ignored.Conditional exports now lower as guarded exports instead of being refused, except the pixel stage's final
doneexport which keeps the old kill-lane path (pixel_doneis computed once and used in both places — the restructure is consistent). The new test builds a PS with a vcc-guardedexpand checks it translates (validator runs on Windows).One coverage note: the test is pixel-stage only. The change also newly accepts guarded exports in VS/GS (previously
a conditional exportfor any non-mesh stage) — the reasoning ("runs only for enabled lanes") holds for VS, but GS exports are per-primitive-stream and worth a second look if a title hits it; not blocking since the old behavior was a hard refusal anyway, so this strictly widens what translates.Imported from Marvisak/VIctory. Originally posted by justr4mzi on 2026-11-24T09:38:36Z.
Independently measured PR #655 (
b9c7699c) merged cleanly ontomain(8e79c80) on Windows 11 with an AMD Radeon RX 6700 XT (RDNA2), Rust 1.98.1 (x86_64-pc-windows-msvc), anddxil.dllfrom Windows SDK10.0.26100.0, againstmain(02f404e) baseline.victory translate --validate(26,599 containers / 26,148 programs)emit: a conditional export: 8 -> 0 (all 8 cleared).emit: a scalar memory read as data: 604 -> 610 (+6)emit: a packed input half no element holds: 166 -> 168 (+2)Build and checks
8e79c80(crates/victory-shader/src/emit/lower.rs,emit/mod.rs).cargo clippy -p victory-shader --lib -- -D warnings: clean.cargo xtask policy:153 files ok.cargo build --release -p victory: succeeded.AI-assisted test execution and comparison (reviewed locally).
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T14:00:19Z.
Review: APPROVED
NVIDIA cross-vendor verification — tested merged cleanly onto
main(ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC) with NVIDIA GeForce RTX 5090 (Blackwell) and WARP:cargo test -p victory-shader: 121 passed, 0 failed, 1 ignored (all hardware + WARP VALU/waterfall/diff tests green on RTX 5090 and WARP)cargo clippy -p victory-shader --all-targets: 0 warningscargo xtask policy: okMatches the AMD/macOS results on NVIDIA Blackwell hardware as well. Approving.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Halfect on 2026-11-24T13:23:33Z.
Rebased onto current main
ffe310eand fixed the call flagged in #801: the new regression now passes the fourthresource::trackargument asNone(the test has no per-lane descriptors, so this keeps the old behavior). Head is now1bd52dc.Validation on Windows:
a_conditional_pixel_export_is_guarded: passed, including its Windows DXIL validation (dxil.dll 10.0.26100.0).cargo check --locked -p victory-shader --tests: passed.diff_tests,valu_tests,waterfall_tests, andstub_pipeline_is_created: 98 passed, 0 failed, 1 ignored.cargo clippy --locked -p victory-shader --lib --tests -- -D warnings: clean.cargo xtask policy: 154 files ok.No GPU execution was used for this validation.
Imported from Marvisak/VIctory. Originally posted by DeerSilver on 2026-11-24T14:04:23Z.
Re-tested head
1bd52dcmerged ontomainffe310e(clean merge) on NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1. No game files: the test suite only. Pass, with no local change: theresource::trackcall from #801 now builds.a_conditional_pixel_export_is_guardedpasses. It doesn't use the GPU, but its DXIL check did run: the Windows SDK10.0.26100.0\x64\dxil.dllis installed here, soValidator::loadfound it.cargo test --workspace --locked, the full workspace including the VALU and waterfall GPU groups (which ran on the RTX 5060): 343 passed, 0 failed, 6 ignored, against 342 / 6 onmain.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by molodayamama on 2026-11-24T14:04:31Z.
Independent Windows check of
1bd52dcc9e4d2f863123f32a944c7ee4412c6852(Windows 10 22H2 19045, Rust 1.98.1, MSVC x64).cargo test -p victory-shader --locked --lib a_conditional_pixel_export_is_guarded -- --test-threads=1 --nocapture: 1 passed.The synthetic pixel shader fixture verified that a conditional export is emitted with a guard. This was a lowering check without rendering.
Only source-built synthetic fixtures were used. AI-assisted verification.
Imported from Marvisak/VIctory. Originally posted by Halfect on 2026-11-24T14:22:10Z.
Thanks @DeerSilver and @molodayamama for the quick re-tests of
1bd52dc— good to have the full workspace suite green on the RTX 5060 and the guarded-export fixture confirmed on a second Windows setup. Nothing further from my side on this head; ready for review.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-24T14:31:33Z.
I ran a synthetic raster comparison on
1bd52dc. A 4×2 full-screen triangle uses complementary EXEC masks for two non-final exports to MRT0, then restores EXEC and exports to MRT1. On the Windows default hardware adapter and explicit WARP, MRT0 was red in the left two columns and green in the right two. All eight pixels in MRT1 were blue. Both images matched an independent DXC HLSL reference pixel for pixel.In a local control with the non-final export guard removed, the shader still passed DXIL validation, but the second MRT0 export painted all eight pixels green on the hardware adapter. MRT1 still read back blue.
Test commit adds the dual-target readback to the test harness and keeps the original lowering test.
victory-shader --libpassed 122 tests with one benchmark ignored. Clippy and the asset check passed.Imported from Marvisak/VIctory. Originally posted by Halfect on 2026-11-24T14:48:05Z.
Thanks @fuzeofficlal for the raster cross-check on
1bd52dc. The result matches the intended semantics exactly: with complementary EXEC masks, the guarded non-final exports leave the disabled lanes' previous MRT0 values untouched (red/green split), and your control without the guard painting all eight pixels green confirms the guard is what carries the behavior. Pixel-for-pixel agreement with the independent DXC HLSL reference on both hardware and WARP is a strong signal.I'll keep this branch as-is: its synthetic regression covers the lowering plus DXIL validation, and your dual-target readback harness is a useful external check on top of it. Nothing further from my side on this head; ready for review.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:27:01Z.
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Main handles the title's 8 conditional exports (
13091f6e: a non-done pixel export stores in every lane when the done export discards the lanes its guard leaves out; emit/lower.rs export()).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.
Pull request closed