Shaders: preserve live interpolation values (on #453) #1738
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1738
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1738"
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 21:40 UTC · original
jaschinski97-ops:fix/upstream-live-interpolation→main· +1401 −138 · 6 files · 10 commits · closed without mergingKeep the real value of an interpolation first half, P0 + i*(P1-P0), when it is exported alone, consumed beside a folded pair, used through a phi, or used as another interpolation's weight. Omitting it can refuse translation or lose the partial result.
Includes #453's barycentric/Weighted infrastructure, with its original author commit retained. Updated against main
940d32f, preserving Elsewhere/unless proofs, packed input/signature handling, initialized pixel SGPRs, and the merged f16 output-modifier fix in #1696. Coordination: PR #1738 in #1633. This complements #1099: replacing an unlinked first half with zero does not preserve its value.Track demanded first halves through SSA dependencies and phis, retaining the unwritten destination half of f16 P2.
Allow P0 vertex reads beside ordinary interpolation of the same row: retain flat vertex access and evaluate the interpolated value from vertices. P0-only and ordinary-only paths retain their existing feature requirements.
Avoid extra barycentric requirements for a dead first half overwritten under entry EXEC or a safe ordinary pair after register reuse. Keep masked-move dependencies.
Resolve conditional pairs using the existing avoids proof before final liveness/signature selection. Unsafe pairs use actual native weights, including transitive first-half dependencies.
Preserve op_sel destination halves, omod and clamp in both ordinary and Weighted f16 paths.
Validation: Windows 11, NVIDIA GeForce RTX 3080, driver 32.0.16.2140; Rust 1.98.1 Windows GNU.
Standalone, dead-overwrite, safe-ordinary/no-extra-feature and f16-preservation regressions fail before their respective corrections.
Final targeted suite: 20 barycentric tests pass, including real GPU rendering. An 8x8 synthetic triangle checks 6,656 channel results across RTX 3080 and WARP: standalone f32, partial+full f32, exact f16 bit preservation, computed i/j in place, high-half writes with omod/clamp and a preserved low-half marker, and P0 before/after an interpolation in the same/different channel.
CPU tests also cover phi reads, masked moves, transitive computed weights, upstream ordinary-register reuse and output modifiers. Clippy, all targets/all features, warnings denied: passed. Asset policy passed.
Fixtures contain synthetic instructions and vertex data only. No game boot, image-quality or FPS claim is made. Hosts without barycentrics skip render checks; existing barycentric-mode restrictions remain.
AI-assisted with Codex: separate worktrees for research and implementation, followed by independent reviews and coordinator GPU validation. GPU test processes were serialized centrally.
Combined local validation before the P0 follow-up (main
940d32f+ all three contributions, integration cfa116d):cargo clippy --locked --workspace --all-targets --all-features -- -D warnings: passed.cargo test --locked --workspace --all-features --no-fail-fast -- --test-threads=1: completed unfiltered; six tests fail. Shader suite: 271 passed, 3 failed, 3 ignored. GPU suite: 145 passed, 2 failed, 2 ignored. The five GPU/shader failures were independently reproduced on bare main940d32f. The sixth isloads_binds_and_calls_probe: its unchanged fixture passes MSVC/DELAYLOADto the local GNU linker, which rejects it.The baseline failures are
dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views,a_heap_buffer_read_by_element_takes_the_views_stride,a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, andgathers_at_a_level_match_the_hardware. The full local workspace run is therefore explicitly not reported as passing.New regression tests and the repository asset policy pass. All three PRs also pass GitHub's Windows MSVC CI. Green CI does not substitute for the separately reported RTX readback evidence.
P0 follow-up
08e2e07: the synthetic mixed P0/ordinary-row case failed before the correction withone input interpolated two ways; all four order/channel combinations now validate and render correctly. Twenty targeted tests, shader Clippy (all targets/all features, warnings denied), and asset policy pass. Claim: #1633. Full current-head shader rerun: 267 passed, 3 failed, 3 ignored. The three failures are exactly the independently reproduced main-940d32f heap/stride/gather baseline cases listed above. Windows MSVC GitHub CI passes on08e2e07(run https://github.com/Marvisak/VIctory/actions/runs/45600161321).Refresh against main
67e8ae1(2026-11-25)Current-main refresh: head
9d59892merges main67e8ae1401df112248aed36d0024483181b718b7and adapts the new countedv_movreldinput-initialization proof to lazy barycentric reads. The overwrite proof is checked before loading a phi's original input, so a complete overwrite still introduces no BARYCENTRICS requirement. The upstream test's former unsupported-barycentric outcomes now verify the retained input instead of rejecting a newly supported shader: 2 complete-overwrite cases have no barycentric feature/input, and all 13 other cases retain exactly one barycentric element. All 15 generated shaders pass the local DXIL validator.On the refreshed stack: 17 general emitter tests and all 20 interpolation tests pass, including the 13 render cases / 6,656 channel checks on RTX 3080 and built-in WARP. Workspace Clippy, all targets/all features with warnings denied, passes on the combined stack. The asset policy passes. GitHub Windows MSVC CI: https://github.com/Marvisak/VIctory/actions/runs/45652319615 (passed on this head). Earlier full-suite results above are explicitly tied to their older main revisions; no new full native-workspace pass is claimed.
Coordination bookkeeping: the earlier claim label was incorrect; see the correction. The completed P0 follow-up is assigned as NEW-120.
ffe310e) into up/pixel-barycentrics 3bc83d0d7bDXIL allows at most two SV_Barycentrics input elements, one perspective and one linear. A program reading both perspective center and centroid I/J as values declared two perspective elements, which the validator refuses ("There can only be up to two input attributes of SV_Barycentrics with different perspective interpolation mode"). The second mode of the same kind is now an Unsupported reason rather than a second element. Reusing the first element would hand centroid reads center weights (or the reverse), which differ on edge pixels: a silent wrong value. Before this PR such reads were refused anyway. Test: center + centroid values are refused; centroid alone still translates with one element. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm6670564aeinto live interpolation 49a80f63ad67e8ae1into interpolation follow-up ee22464400@HocotateGuy15 on GitHub · 2026-11-24 21:50 UTC · original
Independent offline verification for a cutscene shader that the runtime producer trace linked to two missing 1440p texture outputs. On Windows 10 22H2 / RTX 3070, the exact pixel-shader container previously failed translation with "the first half of an interpolation" at its color export. The trace followed the unavailable first-half value through SSA merges to that export. PR #1293 and PR #683 each left this specific failure in place in local offline comparisons.
I tested this PR at
d39a027on the same container, selected by its runtime BLAKE3 prefix 7778fb128a65511e. It translated successfully, and Microsoft's DXIL validator accepted the emitted shader. Five focused first-half unit tests also passed in the integrated diagnostics build. This verifies the identified shader translation failure, while cutscene rendering and the separate driver hang still need a runtime comparison. No game content or disassembly attached.AI-assisted diagnostics and write-up.
@HocotateGuy15 on GitHub · 2026-11-24 21:56 UTC · original
Runtime follow-up on the RTX 3070 / Windows 10 run with #1738
d39a027added to the Agility, Wave64, buffer-transition, bounded root SRV, packed render-target and producer trace test stack. With the final presentation path enabled, the log explicitly reports that the previously rejected pixel shader translated. The prior interpolation error and producer warnings naming that shader were absent. Black frames still occurred, and the process eventually exited with DXGI_ERROR_DEVICE_HUNG following a 32-list submission. The DRED range contains a mesh dispatch (operation 42) without a marker identifying its pipeline. Windows recorded NVIDIA display-driver recovery one second later.This verifies the shader fix in-game. The overall black-screen and driver-reset issues remain open. AI-assisted log analysis.
@Marvisak on GitHub · 2026-11-25 01:35 UTC · original · edited 2026-11-25 16:46 UTC
Automated triage for the maintainers.
Needs work.
What changed since the last triage: the head merges
main67e8ae1and adds9d59892. That commit moves the countedv_movreldoverwrite proof ahead of lazy barycentric loading in the phi lowering (emit/lower.rs), and updates the indexed-input test inemit/mod.rsto expect a retainedSV_Barycentricselement instead of a refusal. It looks consistent with the rest of the PR, it merges cleanly, and CI passes (check).The content itself (first-half liveness in
io.rs,Interp::Weighted, lazySV_Barycentricsreads, P0 beside interpolation) is still backed by the render tests and the archive counts posted above. What blocks it is unchanged: the PR still carries all of #453 (21c585a…88b34a4, by another author). #453 is open, and its author hasn't said anywhere that this PR should replace it. The description now says it includes #453 with authorship kept, but that alone doesn't settle it. Please agree with #453's author on one route:The earlier suggestion to split out the P0-beside-interpolation fix (
08e2e07) still stands. It would make review much easier.Generated by Claude Code
@whamre on GitHub · 2026-11-25 08:59 UTC · original
Tested #1738 (
d39a027) against its baseffe310ewithvictory translate shaders.rpfon my own copy of the shader pack (Windows, RTX 2080 SUPER, release build). Counts only.ffe310eNet +216 VS/PS programs. The 32 new "opaque lane mask" refusals are programs that now get past I/O and stop later; compute (1,441) and mesh (8,214) are unchanged. The 28 first halves match mercuryVM's count on #1099, and from the code a first half read as data keeps P0 + i·P10 rather than 0, which was the concern there.
For comparison, #1682 on the same base gets 12,419: it clears the 207 + 13 but still refuses the 28 first halves.
Not checked: DXIL validation (the Windows SDK 10.0.19041 dxil.dll crashes with 0xC0000005 under
--validate, onffe310etoo) and in-game rendering. AI-assisted.@whamre on GitHub · 2026-11-25 09:10 UTC · original
Follow-up with validation, using dxil.dll from DXC v1.9.2609 (my SDK validator was the crashing one). Same shader pack, per program,
ffe310e→ #1738:ffe310e).Still not checked in game. AI-assisted.
@jaschinski97-ops on GitHub · 2026-11-25 11:00 UTC · original
Current head
08e2e07includes main940d32fand the synthetic-test interface updates. The needs-rebase triage ond39a027is addressed. The previous351dc2dCI passed; this new follow-up is uploaded for CI.The archive measurements above concern the old ffe310e/d39a027 stack. I have not independently run that archive. Current main already harmonizes unused generic-float siblings in a signature row, so the three old row-validator reports do not by themselves establish the same defect on the current head.
A separate current failure is now reproduced and fixed: a P0 vertex read beside an ordinary interpolation of the same row returned
one input interpolated two ways. P0 remains flat; the interpolated value reads the vertices with its proper weights. Four combinations (P0 before/after the pair, same/another channel) validate and render correctly on RTX 3080 and WARP. P0-only and ordinary-only regressions both keep BARYCENTRICS unset.Final targeted run: 20 tests pass, including 13 render cases / 6,656 checked channel results; Clippy all targets/all features with warnings denied and asset policy pass. Full shader/CI reruns will be recorded in the description. Follow-up claim: #1633. #1682's broader, now-closed manual-row work and #2038's isolated P10 handling were checked for overlap. Synthetic fixtures only, no title data or game-playability claim. AI-assisted with independent coordinator review and GPU checks.
@fuzeofficlal on GitHub · 2026-11-26 01:31 UTC · original
Code review and RTX 5090 + WARP + DXIL verification at head
9d598928c7b6merged ontomain(63bcca43c6a0):xtask):#453commits), butcrates/victory-shader/src/emit/lower.rsreaches533,630bytes (+9,342B over the524,288-byte limit), causingcargo xtask policyto fail:POLICY: crates/victory-shader/src/emit/lower.rs: 533630 bytes exceeds the 524288-byte limitbarycentric,interp,eval_channel,vertex_input) into a submodule underemit/lower/will clear the policy gate cleanly.Interp::Weighted/retain_live_first_halves(io.rs:495-610),lazy_barycentric(lower.rs:1442-1778),overwritten_movreld_edgepriority infill_phis, andtranslate.rs:709accounting all checked out cleanly.clippy(default +--features diagnostics+victory): 0 warnings;io::tests7/7;emit::lower::tests33/33;emit::tests17/17;emit::barycentric_tests20/20 passed (includingfirst_half_values_render_on_hardware_and_warpacross all 13 render cases on RTX 5090 + WARP);emit::semantics_tests34/34 on both RTX 5090 and WARP (1 ignored).Implementation and hardware rendering look great — just needs extracting helpers out of
lower.rsto passxtask policy.@Anzymanz on GitHub · 2026-11-26 03:39 UTC · original
From a tester working with Claude (AI-assisted, Claude Code): an offline check of this PR over a whole title's shader pack (25,889 distinct containers through
emit::translate_with; hashes and counts only).63bcca4+ #3016 (an unrelated SALU fix), then with this PR merged (9d598928, no conflicts).barycentrics read directlyrefusal (5067d502a1b4ffb4) now translates: refused 216 → 215.Not run: your GPU tests, NVIDIA, and the title in a game run, so this says nothing about the pictures of the 10,236 programs that changed but were already translating. Translation and conversion only.
@zed6000 on GitHub · 2026-11-26 04:32 UTC · original
Measured offline on the title's shaders (the method in #1247), head
9d59892merged ontomain63bcca4(a clean merge, security-reviewed first): +1, 0 lost. The one is the only program onmainthat refuses withemit: barycentrics read directly.cargo test -p victory-shader --lib --lockedpasses 325/0 on an RX 7900 XTX.That makes it the last piece. With the stack in #1247 (#1924 port, #2978, #385, #2999, #1737, #3016, #2363), every program of the title except the 71 mesh programs over the validator's output size would validate. One caution for the merge order: this PR edits
fill_phisinemit/lower.rs, and #385 movesfill_phisintoemit/lower/phi.rs. #1924 also extends theLowerfields where this PR changesinterpsto ownedInterpand addsinterp_live. So against those two it's a real port, not a keep-both, and I haven't measured it on the stack. Offline counts only; no program names or data.@r4tedx on GitHub · 2026-11-26 07:07 UTC · original
Tested
9d598928merged onto currentmain(842b0cb). It merges cleanly.Thanks for
9d598928.indexed_move_initializes_an_input_before_its_first_usenow checks what a case keeps: the cases that read the input before thev_movreldloop declareSV_Barycentricsand the Barycentrics flag, and the complete overwrites declare neither. All of them validate. That was the stale expectation from my last comment, and the test passes now. The overwritten-input check inlower.rsnow runs before the lazy barycentric load, so an edge the loop overwrites no longer loads the input.Census (
main842b0cb, 64-lane target): 24,850 → 24,851 validated, 0 lost, 1 pixel program gained (barycentrics read directly; no program is left with that reason). Nothing else changes in the listing. On currentmainno program stops at "the first half of an interpolation" or at "an interpolation with computed barycentrics", so this title does not measure the live-interpolation part of this PR.Tests (WARP,
victory-shaderlib,main+ this PR): 320 passed, 4 failed, the same 4 that fail onmainon this machine's WARP. The barycentric, first-half and indexed-input tests all pass. Clippy (victory-shader, with and without--features diagnostics): clean.The unit tests are synthetic. Local title data was used offline for the census: a translation of the title's shader pack, with only counts and refusal reasons reported.
AI-assisted
@zed6000 on GitHub · 2026-11-26 13:11 UTC · original
Following up on the merge-order note above: I ported this PR (
9d59892) onto the full stack from #1247 (#1924 port, #2978, #385, #2999, #1737, #3016 and #2363 onmain63bcca4). The resolution, for whenever this rebases after those land:emit/lower.rs,Lowerfields: take this PR'sinterps: HashMap<Site, Interp>andinterp_live, and keep #1924'sgs_reads,lds_outputs,gs_outputs,gs_opsandmerged_wave_maskafter them. The same goes for their initialisers inLower::new.emit/lower.rs,Input::Barycentric: take this PR'sreturn self.barycentric(kind, index)and keep #1924'sPrimitiveId/GsInstanceIdarm after it.fill_phis: #385 moved it intoemit/lower/phi.rs, so drop this PR's copy inlower.rsand carry its three changes into the moved function. Computeoverwritten_input(noread &&needed, because that loop already skips edges that aren't live), calllazy_barycentric(arg)under the same guards, add the_ if overwritten_input => undefarm first, and remove the oldMissing("barycentrics read directly")arm.phi.rsneedsuse crate::io::Input;.io.rs, end ofraise: keep #1924's merged-geometry match, then this PR'sretain_live_first_halvescall, thenOk(io). Keep both sets of new items after it (LdsAddr/ds_elements/raise_es_gs_lds, thenretain_live_first_halves).Measured on that port (offline, the title's shaders, RX 7900 XTX): +1 on the stack, 26,013 of 26,084 validated (+1,163 on
main, 0 lost). The only programs left are the 71 mesh programs over the validator's 32,768-byte output size.cargo test -p victory-shader --libpasses 357/0,-p victory-gpu --libpasses 231/0, andcargo clippy -p victory-shader --all-targets --locked -- -D warningsis clean. Offline counts only; no program names or data.Pull request closed