Shaders: v_fma_mixlo/mixhi over an f16 first interpolation half keeps zero (8 pixel programs) #77
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!77
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/77/head"
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?
@m335671 on GitHub · 2026-11-24 21:16 UTC · original
m335671:fix/mixlo-interp-first-half→main· +31 −4 · 2 files · 1 commits · closed without mergingSummary
8 of the title's deferred material pixel programs failed with
emit: the first half of an interpolation. The interpolation pairing itself was fine. What failed was a 16-bit write further on:v_fma_mixlo_f16keeps the high half of its destination, so the lowering read the oldv8withi32_of(..)?. That old value is the first half'sVal::Missing, so it propagated to the colour export and refused the whole program. Nothing reads that high half.write_halfandlow_halfalready treat an old value that has none as zero. This change makes thev_fma_mix*arm do the same.Changes
crates/victory-shader/src/emit/lower.rs: in thev_fma_mix_f32 | v_fma_mixlo_f16 | v_fma_mixhi_f16arm, an old destination without a value keeps 0 instead of failing the program, aswrite_halfdoes.crates/victory-shader/src/emit/mod.rs: testmixlo_over_an_f16_first_interpolation_half. It is a pixel program withv_interp_p1ll_f16/v_interp_p2_f16, thenv_fma_mixlo_f16into the first half's VGPR. It fails without the change (Unsupported { offset: 28, what: "the first half of an interpolation" }) and passes with it.pixelgets apixel_with(.., fp16)variant for the 16-bit TEXCOORD0 the test needs.Verification
4e17478.cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-features: 0 warnings.cargo test --workspace --locked: 497 passed, 0 failed, 7 ignored (the new test included).cargo xtask policy: 169 files ok.victory translate --list --validateover the title's shader pack, base90228a7(4e17478changes no code) against this change. Aggregate counts and hashes only, no game data:emit: the first half of an interpolation: 8 → 0validated:38bf0814e721a1b3,78f3f2fc53a69531,8445dcb2b63aa197,007bb29b393d08c5,15547db9d31b056b,288c43f50bc7abee,5ddcaa08d4a51215,464ea474374b8ecd.VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024, on90228a7+ this change):38bf0814e721a1b3and78f3f2fc53a69531logshader translatedand get host mesh pipelines.78f3f2fc53a69531is first bound at frame 1880.7b0f736/1684989in the same scene, both were in theshader does not translatelist.Not tested
write_halfalready assumes.AI use: Claude Code (Claude Opus 5.5) found the cause, wrote the change and the test, ran the checks and the title on my machine, and wrote this description.
🤖 Generated with Claude Code
@T0ns1 on GitHub · 2026-11-24 21:24 UTC · original
In-game data point for this change, from an independent fix of the same failure (same diagnosis:
v_fma_mixlo_f16keeping the high half of a VGPR that holds an f16 first half).Setup: Windows 11 Pro 26300, RTX 5070 Ti 16 GB (driver 32.0.16.2140, 32-lane waves), Ryzen 7 9800X3D, 32 GB. Release build of
main4e17478plus the equivalent change, Series X profile.VICTORY_HOST_WAVE=32: vertex and pixel programs emitted 14156 → 14164 of 14247; the 8 "first half of an interpolation" failures are gone, and every other failure count is unchanged.PS_DeferredTextured(#38bf0814e721a1b3) now translates, validates and makes a host pipeline.shader does not translate; its pipelines' draws are dropped stage="pixel" hash=38bf0814e721a1b3(and 3PS_PuddleDetectvariants).cargo test --release -p victory-shader: 210 passed, 0 failed, 2 ignored.AI use: Claude Code (Claude Opus 5.5) traced the failure, made the change, ran the tests and the game.
@dkdknight on GitHub · 2026-11-24 21:34 UTC · original
Tested on an RTX 5080 (merged with #71, #81 and #38 on
4e17478):38bf0814e721a1b3and78f3f2fc53a69531translate, and the run had no device removal.shader does not translate(the first half of an interpolation) on4e17478andshader translatedwith this PR, in the same scene (Series X profile, same save, ~2 min standing in the world).4e17478, 5 with the four PRs (all compute). The frame numbers for the merged build are on #71.Setup: NVIDIA GeForce RTX 5080 16 GB, driver 621.14, i9-13900KF, Windows 11 26200, release build.
AI use: Claude Code, Claude Opus 5.5 built the merged branch, ran it on the machine above (the person at the machine played) and read the logs.
@adriaespii on GitHub · 2026-11-24 21:37 UTC · original
Independent test run on commit
a6388aa(AMD RDNA4):x86_64-pc-windows-msvc)cargo clippy --workspace --all-targets -- -D warnings: 0 warningscargo test --workspace: 497 passed, 0 failed, 7 ignored (victory-shader: 211 passed, 0 failed, 2 ignored;victory-gpu: 110 passed, 0 failed, 1 ignored)AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.
@rocobalt1 on GitHub · 2026-11-24 21:41 UTC · original
Offline coverage of this PR on the retail shader pack, measured alone on its base
4e17478.Method: worktree at
4e17478,cargo build --release -p victory, thenvictory.exe translate <shaders.rpf> --validate --list --jobs 20with the same Windows SDK validator, compared program by program by program hash against the same command on4e17478alone.4e17478+8 gained, 0 lost.
The eight:
And these are precisely the programs the title is missing on my machine. On
--console series-sthe run refuses three pixel pipelines withconverter shader.dxil v1: GFX10 code at 0x1464: the first half of an interpolation is not supported, and their hashes map toPS_DeferredTextured_c5fd36bb(twice) andPS_DeferredTextured_9e3a1555- two of the eight above. Their draws are dropped today; with this PR they should be kept.For what it is worth, #52 on the same base gains the same 8 but loses 160 ped/fire pixel programs, so this narrower change looks like the one to take.
No game data; counts and program names only.
@arminkhaleghirod on GitHub · 2026-11-24 21:42 UTC · original
Merged onto main
90228a7and ranvictory translate --validateover the full title (26,148 programs) on Windows 11 / RTX 4080. Changes against main, by failure reason:the first half of an interpolation: 8 → 0Pipeline State Validation does not matchgroup.@rocobalt1 on GitHub · 2026-11-24 22:03 UTC · original
In-title confirmation of what the coverage comment promised: this PR removes the refusal on my machine as well, not only offline.
Same machine, same build as the coverage comment (
4e17478+ #32 + #86 + this PR),--console series-s,VICTORY_FFX_DIRset (AMD FSR 3.1.6 through #86),VICTORY_SHADER_LOOP_LIMIT=256,VICTORY_NO_WATCHDOG=1,VICTORY_D3D12_DRED=1, freshVICTORY_DATA_DIR, RTX 4060 Ti 8 GB / driver 32.0.16.1656.TdrDelay=60here, so times are upper bounds.0x1464: the first half of an interpolationrefusalsThe three
PS_DeferredTextureddraws that were dropped now run. I cannot tell you yet whether the wall that uses them looks right, because the frame is still heavily overexposed on this profile; what I can say is that nothing else regressed in the run (no new refusal, no device loss, frame time unchanged).No game data; counts only.
@m335671 on GitHub · 2026-11-25 06:59 UTC · original
Current
mainalready fixes the 8 programs this PR is about, so this change is no longer needed there.Checked
mainat8dd30ab, diagnostics build,VICTORY_HOST_MAX_WAVE=32 victory translate --list --validate <shaders.rpf>over the title's whole shader pack (RTX 4070, Windows 11).validated:38bf0814e721a1b3,78f3f2fc53a69531,8445dcb2b63aa197,007bb29b393d08c5,15547db9d31b056b,288c43f50bc7abee,5ddcaa08d4a51215,464ea474374b8ecd.the first half of an interpolationany more.3bff182("a first half of a paired interpolation read as data"), which handles it on the first half's side, like #203.8dd30abalone: the first gameplay room and the window are drawn, and the main character's face is complete.I'm closing this as superseded. Thanks to everyone who tested it.
AI use: Claude Code (Claude Opus 5.5) ran the check on my machine and wrote this comment.
Pull request closed