Shaders: retain live interpolation first halves #52
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!52
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-52"
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?
@jaschinski97-ops on GitHub · 2026-11-24 20:57 UTC · original
jaschinski97-ops:fix/standalone-interpolation→main· +404 −5 · 2 files · 3 commits · openA synthetic pixel shader exporting
v_interp_p1_f32without its second half fails withthe first half of an interpolation. The same happens when the partial result is copied for another calculation before an otherwise ordinary loaded-i/j pair completes. That failure message is also reported in #7; the reported title shader itself was not available for validation.I/O raising now records first halves whose SSA values are consumed outside a folded complete interpolation, including values reaching a consumer through phis. They use the existing weighted interpolation lowering (
P0 + i * (P1 - P0)). Normal loaded-i/j pairs retain their current single host interpolation and do not gain barycentrics or per-vertex attribute reads. Computed-weight pairs retain their existing handling.Validation on Windows 11 / NVIDIA RTX 3080, driver 32.0.16.2140, Rust 1.98.1 / Windows GNU:
1e-5.v_interp_p1ll_f16(the f16 form was not executed on the GPU).interpolation_alone_declares_no_barycentricsand computed-weight tests pass, preserving the ordinary-pair optimization.cargo test --locked -p victory-shader --lib -- --test-threads=1: 215 passed, 0 failed, 2 existing ignored tests (90.94 seconds).victory-shader, all targets,diagnostics,host, with-D warnings: clean. Asset policy: 169 files OK.diagnostics,hostand-D warningsand the asset policy pass. The changes combine without conflicts.No gameplay or shader-corpus result is claimed. No title data, dumps or extracted code are included. Synthetic programs and tests are our own. Instruction semantics: AMD RDNA 2 ISA section 12.11, https://docs.amd.com/v/u/en-US/rdna2-shader-instruction-set-architecture
AI-assisted contribution with Codex; code and hardware/software rendering tests run locally.
Additional review corrections in
c194f64: demand-based first-half tracking avoids unnecessary barycentrics for a dead value overwritten by a full move, preserves masked-move dependencies, and retains the old destination High16 of a folded f16 P2. The dead-overwrite test fails before the fix. The extended render test checks 1,536 channel results on RTX 3080 and WARP, including exact old-High16/new-f16-Low16 bits. Final branch shader suite: 218 passed, 2 pre-existing ignored; Clippy and asset policy pass. All fixtures remain synthetic.@adriaespii on GitHub · 2026-11-24 21:14 UTC · original
Independent test run on commit
81a8e2e(AMD RDNA4):x86_64-pc-windows-msvc)cargo clippy --workspace --all-targets -- -D warnings: 0 warningscargo test --workspace: 501 passed, 0 failed, 7 ignored (victory-shader: 215 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 pack, measured on its own (not stacked with the other first-half PRs, because #52 and #77 both edit
emit/mod.rsand conflict).Method: worktree at
4e17478(this PR's base),cargo build --release -p victory, thenvictory.exe translate <shaders.rpf> --validate --list --jobs 20with the same Windows SDK validator, compared program by program by the program hash printed in the--listline against the same command on4e17478alone.4e17478+8 gained, -160 lost.
The 8 gained are the ones this PR is after, and they are real:
PS_DeferredTextured_9e3a1555is refused in the title on my machine (GFX10 code at 0x1464: the first half of an interpolation is not supported), so these 8 are worth having.The 160 lost are all pixel programs, and they cluster on peds and fire:
For comparison, #77 on the same base gains the same 8 and loses 0, so the 8 do not need this PR, while the 160 do come from it.
Is that expected - are the ped/fire programs meant to be refused until something else lands? I did not look at the diff for a reason, only at what the translator does, so this may be a known trade. On my side it is the difference between "worth trying in the title" and "not":
PS_PedAlphaPrepass_Fire/PS_PedTextured_*_Fireare exactly the programs a burning character needs, so I would not run this build to look at one.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 → 0 (DXIL emitted 14,168 → 14,176)signature element TEXCOORD at location (0,2) size (1,2) has interpolation mode that differs from another element packed into the same row. On main they only had the common PSV mismatch.For comparison, #77 clears the same 8 with no new failure reason.
@KaliemSB on GitHub · 2026-11-24 21:43 UTC · original
Tested on the title's own shaders: all 8 "first half of an interpolation" programs now translate, validate and get a pipeline on an RTX 4060, with no regressions in the rest of the archive.
Setup
cargo build --release -p victorydxil.dll1.9.2609.5 (VICTORY_DXIL)4e17478(forkmain) against this PR's head81a8e2e, which ismainplus this PR. Nothing else merged.VICTORY_HOST_WAVE=32 VICTORY_VIEW_LIMIT=999999, the same forms the runtime picks on this card (32-lane waves, view heap capped at 1,000,000)Whole archive (
victory translate <dump> --list, 26,599 containers, 26,148 programs):4e1747881a8e2ethe first half of an interpolationThe 8 programs, each extracted and run on its own with
--validateand then with--pipelines:PS_DeferredTextured78f3f2fc53a69531PS_DeferredTextured38bf0814e721a1b3PS_DeferredTextured8445dcb2b63aa197PS_MirrorReflectionDeferredDecalTextured5ddcaa08d4a51215PS_MirrorReflectionDeferredDecalTextured464ea474374b8ecdPS_MirrorReflectionDeferredTextured288c43f50bc7abeePS_MirrorReflectionDeferredTextured15547db9d31b056bPS_MirrorReflectionDeferredTextured007bb29b393d08c5Two of these (
78f3f2fc…,38bf0814…) were also logged asshader does not translatein a 31-minute game run on this machine at1684989.Tests,
cargo test -p victory-shader:81a8e2egives 212 passed and 3 failed.4e17478alone gives 208 passed and 2 failed.rect::testsfailures already happen onmain.first_half_values_render_on_hardware_and_warp. It fails with the same error:Container part 'Pipeline State Validation' does not match expected for module.VICTORY_DXIL, the tests pick the newest Windows SDKdxil.dll, here10.0.22621.0(1.6.2112). Usingdxil.dll1.9.2609.5, or merging #61 on top, makes all 7 related tests pass: the 5 new ones and the 2rectones.I didn't do a game run with this PR, so I haven't seen these draws on screen.
AI use: Claude Code (Claude Opus 5.5) built the trees, ran the translations and tests, and drafted this; the machine is mine. No game files or extracted shaders attached.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.