Shaders, GPU: 16-bit buffer accesses keep their bits (the face network computed zeros: mouths now move) #927
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!927
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-927"
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?
@tippythetaidum on GitHub · 2026-11-25 13:02 UTC · original
tippythetaidum:gpu/half-views→main· +1249 −22 · 14 files · 6 commits · openNo character's mouth moved when they talked: the network that animates faces computed zeros, because 16-bit buffer accesses lost their bits through the title's integer views. With this change the faces animate, mouths included. I couldn't find this reported in the issues or PRs here.
Problem
Faces are driven by a network that runs on the GPU every frame:
compute_graph_ops:*programs (about 2,650 dispatches a frame in the opening cutscene:CS_ZeroOperation,CS_SiluOperation,CS_GatherAlignedOperation,CS_VecMatMulAlignedOperation,CS_SmallMatMulOperation,CS_ScatterOperation, ...), whose outputped_standard_head_cs:CS_BlendshapeTranslationsHSSGraphOutputExtract(970c4fbb3b017c0e) turns into blend-shape offsets, thenCS_ReconstructBlendshapeNormals(e4a7e088c7780ce8).Those programs move every tensor with
buffer_load_format_d16_x,buffer_load_format_d16_xyzwandbuffer_store_format_d16_xyzw(616, 99 and 441 instructions; all of the d16 typed buffer instructions in the title's shader pack are in these programs). The tensors live in buffers the title views asR16G16B16A16_UINTandR16_UINT(524 and 13 views onto the 24 MB arena in one frame of the opening cutscene): half floats, and plain 16-bit integers (indices) beside them. On the console each channel's 16 bits go as they are.The translator lowered those accesses as floats:
bufferLoad.f32thenlegacyF32ToF16, andlegacyF16ToF32thenbufferStore.f32(emit/lower.rs: "shortcut: d16 data is taken as f16 (integer formats would keep 16 bits)"). A float access through an integer view is outside what D3D12 defines. On an RTX 5080 the load gave 0 for every value.Measured with a diagnostics build that hashes the title memory behind each view of these programs every 4th frame, from the opening cutscene into the prison (frames 1,388 to 3,928 without the change, 1,724 to 3,712 with it, one run each on
f85101b):The zeros were the same with
VICTORY_CARD_BUFFERS=0,VICTORY_LATE_WAIT=0andVICTORY_SHADER_OPT=0(one run each), so it isn't the copies, the flights or the clean-up passes.Change
bufferLoad.i32/bufferStore.i32, the handle annotated asu32), packing and unpacking the halves as before.HostShader::half_viewsnames those descriptors (root parameter, the dword the program loads the descriptor from); the shader cache stores it.State::tables, a table that has a 16-bit float or signed buffer view at one of those places is made afresh for the draw, with that view in the unsigned format of the same layout (descriptor::host::half_view). The title's own heap slot keeps the title's format for other programs. The title's own views here are already 16-bit unsigned, so for this title no extra table is made.emit/halves.rs):CS_BlendshapeTranslationsHSSGraphOutputExtractreads the network's output with plainbuffer_load_format_xthrough the sameR16_UINTviews and uses only the low half of each result as a half float (v_fma_mix_f32 ... sel_lo). Lowered as a float load it read garbage once the output was no longer all zero: specks on some faces' skin with the first version of this branch. A format load whose every channel is read only as a half float (v_cvt_f32_f16, or av_fma_mix*source with itsop_sel_hibit; uses are operand reads, through phis) now takes the same unsigned-integer path and names its place, where every access through that place moves halves and the program picks nothing from that table at run time. In the title's shader pack that adds the head program and 11 lighting and water compute programs that read those views as halves alone: 77 programs name half places in all, 65 of them the network's.State::tables).descriptor::host::half_inexact). It did not appear in the run below.Why integers rather than a float view: I first showed the integer views as their 16-bit float twins and kept the float path. Some characters' mouths started moving, others didn't, and the player's face twitched. The network also moves plain 16-bit integers in these buffers, and the patterns that are not-a-number as halves don't survive the float round trip (1 of the 2,046 did on this card). As integers, all 65,536 patterns go through.
Tested
Windows 11 (26200), NVIDIA RTX 5080 16 GB, driver 621.14, Rust from
rust-toolchain.toml, Series X profile.a253706(8 minutes, cutscene into the prison): the arena, the output and the blend-shape translations changed in 752 of 752, 408 of 408 and 580 of 580 samples; the once-logged format case did not appear.0b0074ewith #24, shader cache rebuilt): in the opening cutscene the waitress's skin is clean again and mouths move, by eye. (The first version left specks on her face and neck; a first form of the format-load rule, without the every-access condition, reached 724 programs and turned her skin grey. Neither form was pushed.) The once-logged format case did not appear; no errors.mainloses the device at world entry on this card (my report is there), and a local diagnostics patch for the trace above (not in this PR).victory-gpuhalves_cross_an_unsigned_buffer_view_unchanged, on the host device: every 16-bit pattern through anR16G16B16A16_UINTbuffer view comes back unchanged moved as unsigned integers (65,536 of 65,536). Moved by way of floats as before, 1 did; that number is printed, not asserted.victory-gpuonly_16_bit_float_and_signed_buffer_views_get_an_unsigned_twinandviews_whose_values_the_console_would_convert_are_named(no device).victory-shaderhalves_go_through_a_table_as_they_are_and_name_their_views: a synthetic program (abuffer_load_format_d16_xyzwfrom a table's first view, abuffer_store_format_d16_xyzwto its second) names both places, passesdxil.dllvalidation, and on the hardware adapter and on WARP stores exactly the halves it loaded, not-a-number patterns and integers above0x7bffincluded.victory-shaderhalf_places_are_the_descriptors_the_program_loads: a range from dword 0 whose program loads its descriptors at dwords 8 and 16 names (1, 8) and (1, 16); with the first descriptor picked at run time instead, only (1, 16).victory-shadera_format_load_read_as_halves_loads_the_integer, on the hardware adapter and on WARP:0x3c00read withbuffer_load_format_xthrough anR16_UINTview and used throughv_cvt_f32_f16comes through as 1.0, both straight and behind a branch with a later masked rewrite of the register; a whole-float use names nothing, and neither does a half load beside a whole-float load of the same view.victory-gpua_fresh_table_holds_the_half_views_past_its_range_starts: fails without the span fix (the next dynamic allocation landed inside the table), passes with it.shader_cacheround trip extended to the new field.cargo test --workspace --lockedon the branch (on0b0074e): 573 passed, 0 failed, 12 ignored; merged with currentmain(3973179;draw.rsis the one file both change, and it merges cleanly): 582 passed, 0 failed, 12 ignored. The device tests ran on the RTX 5080.cargo clippy -p victory-shader --all-targets --lockedon the branch: no warning.cargo clippy --workspace --all-targets --lockedand with--all-features(ona253706, before the later commits): no warning in the lines this changes. Both report 4 warnings in code this doesn't touch, whichmainhas too (draw.rssort_unstable_by,indirect.rsdepth_written,resource.rsplaced_filler_twins,shadow.rsis_multiple_of), so CI's-D warningsstep will stop on those.Not shown
translated_compute_matches_pcneeds the console's compiler and was not run. Its "16-bit and 64-bit arithmetic" case stores halves withbuffer_store_format_d16; the translated program is now shown theR16G16B16A16_UINTtwin of that buffer (View::HalfUintUav), the PC program keeps the float view.AI-assisted (Claude Code): the investigation, the first change and its tests by Claude Fable 5.2; the review fixes, the format-load rule, their tests and this text by Claude Opus 5.5. I ran the game and checked the faces by eye. Counts and log lines only, nothing from the game attached.
🤖 Generated with Claude Code
@avt0m4t48 on GitHub · 2026-11-25 13:14 UTC · original
I found a descriptor range case on
5dc9e63where the translator records the wrong slot for the host view. The range starts at byte 0. The synthetic shader loads its SRV descriptor at byte 32 and its UAV descriptor at byte 64. Lowering recordshalf_views = [(1, 0), (1, 16)]. The SRV is actually at dword 8, so the expected metadata is[(1, 8), (1, 16)]. The range-base control from this PR, which reads at byte 0, still passes and executes on WARP.used_kindreturns the enclosingUsedResource, whosetable_offset_dwordsspecifies the start of the range. The emitted heap index already includes the actual load's byte displacement. The host compareshalf_viewsagainst the individual slot, so anR16*_FLOATSRV at byte 32 would keep its float view while the shader requests an unsigned load. The assertion verifies the metadata mismatch. I did not measure the result of dispatching through that mismatched view.For a statically addressed table load, the relevant offset is the resolved address plus the descriptor's first dword. Runtime-selected descriptors also need format handling for the slot actually picked. Synthetic probe · Windows verification
AI-assisted using Codex.
@Ym1r1710 on GitHub · 2026-11-25 13:14 UTC · original
Ran this on a 5080 (Win11, native D3D12, Series X profile) on top of
0b0074eplus a few PRs, with relay 2, async submit and queue2.Cost is nothing I can see. First cell, median 155 ms a frame, vs 154-156 ms in the runs right before without it. Copies and copy-back are about the same, no device loss, no new refusals in the log. Only the first launch was slower to get going while the changed programs recompiled.
@tippythetaidum on GitHub · 2026-11-25 13:37 UTC · original
Thanks, you're right:
used_kindgives where the range starts, and the host checks the exact slot. Fixed inbefaf3b:half_places_are_the_descriptors_the_program_loads: your case (one entry for a range from dword 0, loads at0x20and0x40) names[(1, 8), (1, 16)]; with the first load's offset taken at run time (from an SGPR), only[(1, 16)].For the title nothing changes: its 65 programs with d16 typed buffer accesses load all 231 of their descriptors from fixed places, each at the start of its own entry (checked against the programs' code), so they name the same places as before.
cargo test --workspace --lockedwith the fix: 571 passed, 0 failed, 12 ignored (RTX 5080).And thanks for the numbers from the other 5080, Ym1r1710.
AI-assisted (Claude Code, Claude Opus 5.5).
@avt0m4t48 on GitHub · 2026-11-25 13:44 UTC · original
Confirmed that your new
half_places_are_the_descriptors_the_program_loadstest passes onbefaf3b. I found a remaining case on the host side when the half descriptor is the last descriptor the shader reads.The WARP probe goes through
State::tables. It binds a two-slot table with one used-resource range starting at dword 0 and an RGBA16_FLOAT view at dword 8. Thehalf_viewsentry(1, 8)makes the table fresh, but the reservation still ends at dword 0 becausenonly uses the range starts and runtime-selected slots. Fresh allocation starts at host slot 2. The next allocation gets slot 3, which the shader needs for its second view. It should get slot 4.Adding the current root parameter's
half_viewsoffsets toselectedbefore the sort/dedup makes the WARP probe pass. This both extends the copied span and includes those views in the existing refresh path for a fresh table. The probe checks allocation on WARP, with no shader dispatch in this test. Probe source · Windows runAI-assisted using Codex.
@tippythetaidum on GitHub · 2026-11-25 14:01 UTC · original
Holding this back as a draft: a side effect found in testing. With this branch some faces show small rainbow-coloured squares on the skin (the opening cutscene's waitress, every time); without it, in the same build and scene, her skin is clean. One A/B each way on an RTX 5080.
Likely cause, from the head program's code:
ped_standard_head_cs:CS_BlendshapeTranslationsHSSGraphOutputExtract(970c4fbb3b017c0e) also reads the network's output with plainbuffer_load_format_x(not d16) through the same 16-bit unsigned view, and uses only the low half of each result as a half float (v_fma_mix_f32 ... sel_lo). The translator still lowers that load as a float load, which through an integer view gives garbage. Before this branch the output was all zeros, so the garbage was zero too; now it's added to some vertices of the face.I'm extending the change to that case (a format load whose every use reads one half as a half float is moving 16-bit integers) and will mark this ready again once the skin is clean in the game.
AI-assisted (Claude Code, Claude Opus 5.5).
@iGoldenNinja on GitHub · 2026-11-25 13:59 UTC · original · edited 2026-11-25 14:55 UTC
We independently reproduced tippythetaidum's facial-network output result on a native RTX 5080 Astral 16 GB (617.14, Windows 11 Pro 25H2 build 26200.9974, Ryzen 9 5900X, 32 GB, Series X profile). Both arms used the same diagnostic executable (
b055481, integrating5dc9e63on92a72df) withVICTORY_FACE_PROBE=1andVICTORY_D16_TYPED_BITS=0or1. At the blend-shape extractor's 1,064,960-byteR16_UINTinput (root 0, dword 16), we saw 0/76 → 69/69 nonzero reads and 0/75 → 59/68 changes across successive comparable reads. In the first 15 seconds at the matched prison camera, nonzero reads went from 0/12 to 13/13. The treatment camera later turned. The local captures leave mouth motion and lip sync open. Pinned Series X A/B reportFor avt0m4t48's displaced-SRV report, our synthetic RTX 5080 and WARP readbacks passed 128/128 at the range start on the original PR. The displaced case went from 1/128 at
5dc9e63to 128/128 on both adapters with tippythetaidum's translator correction inbefaf3b.We also extended avt0m4t48's fresh-table allocation reproduction through production binder dispatch and readback. At
befaf3bthe allocator reserved one slot where our fixture required three. Atefd753e, both adapters preserved the slot-0 FLOAT values and the slot-2 UINT half words in the fresh-table case and when refreshing an existing UINT heap. Our audit found 425/425 typed 16-bit access sites in the 24 observed facial-network producers at their declared range starts. The interior-slot fixture covers a separate path. Pinned descriptor report and testsNovember 25 follow-up — extractor type mismatch. After tippythetaidum's RTX 5080 skin A/B, we checked the saved translation of extractor
970c4fbb3b017c0eagainst the runtime bindings in our two Series X runs. Three ordinarybuffer_load_format_xinstructions read root table 0, dword 16. The emitted DXIL declares a four-component FLOAT buffer and uses threebufferLoad.f32calls, each bitcasting component 0 to an integer and converting its low half to float. Both runs bound a 1,064,960-byteR16_UINTview there. That confirms the load/view mismatch the author suspected. The colored squares were observed in the author's A/B, and our evidence leaves their pixel-level cause open. Updated pinned reportNovember 25 follow-up — exhaustive finite coordinate inputs. On the unmodified
befaf3bproduction translator plus our synthetic fixture, ordinary format X throughR16_FLOAT, ordinary format X throughR16_UINT, and explicit D16 format X throughR16_UINTeach matched 190,464 of 190,464 expected FP32 coordinate sums on both the RTX 5080 (617.14, Windows 11 Pro 25H2 build 26200.9974) and WARP. Each case puts all 63,488 finite binary16 patterns into each of three low-half extract/FMA positions. The valid FLOAT and UINT references differ in 190,454 sums. The fixture uses table parameter 1, dword 16. The live extractor uses parameter 0, dword 16.The earlier DXIL/view mismatch still occurs in the live trace. In this isolated sequence, a float-annotated ordinary load through the UINT view nevertheless produced the expected arithmetic on both adapters. We also observed localized skin mottling on an outdoor officer on the earlier build with the facial change off. That is a different scene and character from the reported waitress regression. A matched visual A/B remains open. Pinned fixture, results, and scope
@tippythetaidum on GitHub · 2026-11-25 15:54 UTC · original
Two more commits, and ready for review again.
b6bf651, the fresh table's span (@avt0m4t48, right again, thanks): a fresh table's half places are added to the selected slots before the sort, as you suggested, so the table reaches them and they go through the same readable path as the slots picked by index. I wrote a test of my own for it rather than taking the probe across (I don't run code from other branches on this machine):a_fresh_table_holds_the_half_views_past_its_range_startsbuilds your case (one entry for a range from dword 0, anR16G16B16A16_FLOATplaced view at dword 8,half_views(1, 8)) and checks that the next dynamic allocation lands after the table's second slot. It fails without the change (the next allocation got slot 3, inside the table) and passes with it. The title's 65 network programs name each of their descriptors with its own used-resource entry, so their tables are the same as before.b9c3781, the specks on faces (the regression I reported above):CS_BlendshapeTranslationsHSSGraphOutputExtract(970c4fbb3b017c0e) reads the network's output with plainbuffer_load_format_xthrough the sameR16_UINTview and uses only the low half of each result as a half float (v_fma_mix_f32 ... sel_lo). Lowered as a float load, that read garbage once the output was no longer all zero. A format load whose every channel is read only as a half float (v_cvt_f32_f16, or av_fma_mix*source with itsop_sel_hibit) now takes the same unsigned-integer path and names its place, but only where every access through that place moves halves and the program picks nothing from that table at run time. Two things I got wrong on the way, both caught before pushing:ir::operand_reads), and phis carry the value on.New test
a_format_load_read_as_halves_loads_the_integer(hardware and WARP):0x3c00through anR16_UINTview comes through as 1.0, straight and behind a branch with a later masked rewrite of the register; a whole-float use names nothing, and neither does a half load beside a whole-float load of the same view. The helpers are inemit/halves.rs, a child module likeintersect.rs(lower.rswould pass the repository's 512 KiB file limit).In the game (diagnostics build of this branch on
0b0074ewith #24, RTX 5080, shader cache rebuilt): the opening cutscene's waitress's skin is clean again and mouths move, by eye; the log has no once-logged format line (the 11 lighting and water programs met only views that carry the integers exactly), no errors, no device loss.cargo test --workspace --lockedon the branch: 573 passed, 0 failed, 12 ignored; merged with currentmain(3973179,draw.rsmerges cleanly): 582 passed, 0 failed, 12 ignored (RTX 5080).cargo clippy -p victory-shader --all-targets: clean. PR description updated.@iGoldenNinja, thanks for the independent reproduction on another RTX 5080 (face output 0/76 -> 69/69 non-zero, the displaced case 1/128 -> 128/128), and @Ym1r1710 for the cost measurement.
AI-assisted (Claude Code, Claude Opus 5.5). Counts and log lines only, nothing from the game attached.
@sawetco on GitHub · 2026-11-25 16:23 UTC · original
Independent RTX 5070 result at
b9c3781(Windows 11, NVIDIA 621.24, native D3D12). In a Series S playthrough with this revision backported tovitutu1/victory-perf@97c3aa2, the player could see mouths moving during dialogue and reported that faces and mouths looked correct in the scenes played through the Gone Fishing camp. We also had the boat readback change enabled. The opening waitress shot would still need its own comparison on this card.Four targeted tests passed both on the PR head and on our integrated build. In
halves_cross_an_unsigned_buffer_view_unchanged, the integer-view path preserved 65,536 of 65,536 distinct 16-bit patterns. The float control preserved 1 of 65,536. The fresh-table span, format-load-as-halves, and table half-view metadata tests also passed in both builds.The runtime recorded two dispatches each for
970c4fbb3b017c0e(blendshape output extraction) ande4a7e088c7780ce8(reconstruction) in frame 2304 of the Lucia dialogue. The dispatch counts come from the renderer. Mouth movement was observed by the player, with no lip-sync timing measurement.@tippythetaidum on GitHub · 2026-11-25 16:29 UTC · original
Thank you, @sawetco: a second card, a backport into another tree and scenes well past the prologue are a lot more than I could test here. For the waitress shot: on the RTX 5080 her skin is clean again at
b9c3781and the mouths move, by eye in the opening cutscene (the regression I reported above, and its fix, are both described in my comment before yours).AI-assisted (Claude Code, Claude Opus 5.5).
@UwUCammie on GitHub · 2026-11-25 16:59 UTC · original
Tested on RX 7900 XT (CachyOS Linux, Wine 11.22 + vkd3d-proton + RADV). Merged cleanly onto a 3973179-based stack, all
victory-shaderunit tests pass, and ran 480–540 s gameplay passes to frame 4600 with no artifacts or crashes.@CuteBooty on GitHub · 2026-11-25 17:52 UTC · original
Mouths move on an RTX 3070 8 GB in Series S; skin clean on a warm cache
The four commits (through
b9c3781) cherry-picked onto our tree, which has its own handling of fresh tables' dynamicslots (RecompLive 6b44e423's span) and a split dynamic ring. Conflicts were in tests only; in
descriptor.rsthePR's fresh-table test had to ask for two slots where it asks for one, because our ring hands single slots out from
the top.
dark and speckled for the whole run; on the next launch it was clean. I take that for the character bake running
before its textures were there during the slow launch, not for this PR, but anyone testing right after a cache
rebuild may see it.
Setup: RTX 3070 8 GB (driver 621.24, 32-lane waves), Ryzen 5 3600, 32 GB, Windows 11, Series S mode (PR #188), 1920x1080,
VICTORY_TEXTURE_DROP_MIPS=1, relay at its default, a diagnostics build of a tree at main310c6eb6with a number of open PRs picked. One run per configuration unless said; run-to-run spread here is 5-10 ms.@tippythetaidum on GitHub · 2026-11-25 17:58 UTC · original
Thanks, @CuteBooty: another card, and an 8 GB one, is good to have.
On the blue patch near an eye: I see something like it on the RTX 5080 too. In a few close-ups the irises take a blue-violet, sky-like colour instead of their own, and later shots of the same face are normal. All my runs so far had this PR together with #823 (whose reflections now run on NVIDIA), so I can't yet say which of the two it follows. A run without #823 is queued; I'll post here if the result points at this PR.
AI-assisted (Claude Code, Claude Opus 5.5).
@ThomasHFWright on GitHub · 2026-11-25 18:12 UTC · original
Validated the four commits through
b9c3781349in a Linux/Proton integration (CachyOS, Ryzen 7 9800X3D, RTX 5090, NVIDIA 620.73.04, GE-Proton 11-14).Native shader suite: 185 passed / 2 ignored. Windows shader: 234 passed / 1 existing stub-pipeline failure / 3 ignored. GPU: 211 passed / 4 existing runtime failures / 8 ignored. Exhaustive UINT-view readback preserves 65,536/65,536 half patterns versus 1/65,536 for the float control.
Integration retained residency-aware table cache keys and fixed preparation of interior half slots already using UINT without a CBV. Final review found two additional cases, corrected locally:
Six native emitter regressions cover these cases and retained pure d16 paths. Restoring the earlier behavior fails four of them; the pure-path and dead-rewrite controls still pass. Conservative mixed/dynamic-alias fallback uses the old float path and is explicitly NOT lossless for integer/NaN payloads. Exact mixed-format support needs a separate binding or format-aware lowering.
Source/details: https://github.com/ThomasHFWright/LinVictory/blob/linux-edge/docs/pr927-integration.md
Title rendering remains incomplete; different scenes prevent a controlled facial-rendering improvement claim. AI-assisted integration/testing with OpenAI Codex. No proprietary inputs or raw logs attached.
@tippythetaidum on GitHub · 2026-11-25 18:40 UTC · original
Thanks, @ThomasHFWright, this is a careful review and both cases are real in this PR.
half_views, and the float read would then see the unsigned twin. Both sites now require the place to be inplaces_read_as_halves()for d16 too (which already counts d16 accesses as half ones). Mixed places fall back to the float path, as they did before this PR.read_only_as_halvesskipped a later write of the register entirely. But that write keeps the loaded value in the lanes EXEC leaves alone, and those lanes go on to whatever reads the new value. It now follows the value such a write makes, as it follows phis, including an in-placev_cvt_f32_f16that also reads the value as an operand.Three cases are added to the test, each asserting on
half_views: a d16 load alone still names its place; a d16 load beside a whole float read of the same place names nothing; a value converted in place under EXEC and then added as a float in every lane names nothing.Before I push, I'm checking one thing on the real pack. This morning the head program's Extract (
970c4fbb3b017c0e) was only caught once masked rewrites of its load registers stopped counting as uses. Following the kept values is stricter again, and if it drops that program, the mouths stop moving. So I'm re-running the census of programs that name half places, along with the without-the-fix test runs and the full suite. I'll push once that's done, or say here if the stricter rule loses Extract, along with what I'd propose instead.AI-assisted (Claude Code, Claude Opus 5.5).
@tippythetaidum on GitHub · 2026-11-25 19:47 UTC · original
Follow-up on the two cases, @ThomasHFWright, with the census of the whole pack this time.
1. d16 beside a whole float read: pushed in
5a55384. Both sites now require the place to be inplaces_read_as_halves()for d16 accesses too. On the pack it changes no program: all 65 programs with d16 places keep them. The one test that moved is a synthetic d16 store in a table the program also indexes at run time. It now takes the float path, as you describe for potential dynamic aliases. Two cases are added toa_format_load_read_as_halves_loads_the_integer: d16 alone still names its place, and d16 beside a whole float read of the same place names nothing. The second fails without the change.2. Values kept by masked writes: not pushed, because following them as written drops the program this PR exists for. I implemented it as you describe, following the value every later write of the register keeps in the lanes EXEC leaves alone, in-place conversions included. The census then fell from 77 programs to 65. The 12 lost are all format loads (d16 = 0), among them the head program's
CS_BlendshapeTranslationsHSSGraphOutputExtract(970c4fbb3b017c0e), whose half reads are why mouths move. The others are 11 lighting programs: light proxies, irradiance-cache and probe shading, screen-probe injection, water and scattering tiles.A trace of Extract shows why. Its three loads run under one narrowed EXEC (
v_cmpx_ne_u32). The compiler then reuses those VGPRs in later regions under other masks (v_mov_b32,v_lshlrev_b32,v_rcp_f32), and every float use that rejected the place reads the new value under the same EXEC as the write that made it. So it only ever sees that write's lanes, never the loaded ones. Following kept values without looking at the masks counts those as uses.The sound version needs two pieces of lane reasoning, and I'm writing it next:
v_cmpx/s_and_saveexecnarrowings back to a common ancestor.Your in-place conversion case (a conversion under a narrower EXEC, then a whole-float read under the wider one) is still caught by both. I'll post the census and the tests when it's in.
AI-assisted (Claude Code, Claude Opus 5.5).
@tippythetaidum on GitHub · 2026-11-26 00:07 UTC · original
Rebased onto
maindc4c0fc, which had moved to conflict with this branch.descriptor/host.rs: #911's constant-view test and this PR's half-view tests had been added at the same place, so both are kept.d4b786f: the scalar-load dispatch test that came tomainwithc36971bbuilds aHostShader, and now nameshalf_views(l.half_views).cargo test -p victory-shaderpasses 219 andcargo test -p victory-gpu --libpasses 198 on this tree.d827419(25 November). That's the build we played from the prologue into Chapter 1 with faces and mouths right.AI-assisted (Claude Code, Claude Opus 5.5).
@DuarttBR on GitHub · 2026-11-26 02:04 UTC · original
Confirmed on an RTX 3080 10 GB (Ampere, 32-lane waves): mouths move.
Machine: Windows 11, Ryzen 9 5900X, 32 GB RAM, RTX 3080 10 GB, native D3D12.
Tree: a private NVIDIA tree built on soldsawn/victory-nvidia-8gb plus a few PRs. I cherry-picked this PR's commits
323a2a0,4c7626d,6aac62f,01c9f93and896aa4c(the sixth,d4b786f, only touches a test my tree does not have). The conflicts were inlower.rsanddescriptor/host.rsonly: the module declarations (my tree already hasdescriptor_dataandfloat64as child modules) and base code that sits elsewhere in my tree. The logic of the change is untouched.Result: Series X profile, the title's 4K frame shown in a 1080p window, 22 minutes of play from the prologue to the boat mission. Before: no character's mouth moved, in any run and with any set of switches. After: mouths move when characters talk (confirmed by eye by the tester). No device loss and no new translation or pipeline errors in the log. Frame rate unchanged within noise (world median 6.0 fps against 5.7 on the same kind of scenes before; the card is not the limit in these scenes).
The shader cache has to be rebuilt once (the translator's key changes): 25,689 programs in 255 s on 16 threads, then 3,620 pipelines in 703 s.
AI-assisted (Claude Code, Claude Sonnet 5.5). Counts and descriptions only, nothing from the game attached.
@UwUCammie on GitHub · 2026-11-26 02:29 UTC · original
On an RX 7900 XT (RADV 26.3.1, Wine, vkd3d-proton), the integer-view test preserved 65,536/65,536 patterns. The float control preserved 1/65,536. The table-span, fixed descriptor and format-load tests passed as well.
I still see a facial deformation in the opening diner dialogue on this integration. The seated character has visible skin and her mouth changes shape between lines, but the upper lip pulls up toward the nose, exposing teeth high above the lower lip. The same shape is visible in older captures carrying the earlier version of this change. In the same sequence the server can have a nearly black face while her forearms and shirt render. I can reproduce the mouth issue on a face with visible skin. The renderer logged host pipelines for both blendshape output and normal reconstruction. I haven't isolated the bad value to a specific dispatch.
RX 7900 XT integration tested
@bordersky on GitHub · 2026-11-26 07:12 UTC · original
A second RX 7900 XT data point for the deformation @UwUCammie describes, on Linux too.
Setup: RX 7900 XT 20 GB, Arch, Wine (GE-Proton10-34) + vkd3d-proton master, Mesa RADV, Ryzen 9 5900X. Tree: avatarmanz/VIctory-7900XTX main at
9c23e8dwith this PR's six commits cherry-picked. avatarmanz already carried the heap-picked half of the fix (VIctory4243a96a,integer_view), solower.rsanddraw.rsconflicted. I kept both: table views take this PR'shalvespath, and heap-picked views keepinteger_view(typed && !halves). Settings:play.ps1withVICTORY_FETCH_CHECK=1(needed on vkd3d-proton for relay stage 2, avatarmanz#138).Result, new game, prison scene, gameplay (not a cutscene):
So on RDNA 3 under vkd3d-proton the network now runs and moves the faces, but on some faces the blend-shape output comes out too large. That fits a difference in the values the network computes there, rather than in where they go. I have not isolated a dispatch either. Happy to run a diagnostics build or a hash of the arena and output on this setup if that helps compare with an NVIDIA run.
@slauko on GitHub · 2026-11-26 09:47 UTC · original
Ported to my line (Wine, RTX 3080 Ti, vkd3d-proton
ec20719, uiliannn's base) and it applies and works as written —HostShader::half_views, the unsigned twin indescriptor::host::half_view, the table made afresh at those places; the frame time did not move (266 to 275 ms a frame in the cell, as before).One thing it does not fix here, in case someone expects it to: the face. The head is still a black void with the eyes and mouth floating in it (
m12,m13). What the log shows instead is a missing pass, not a wrong value:(
2da4beb386509b77the second one; I wrote this up on #1176.) If the face network is one of those two dispatches, no 16-bit fix can reach it. On a host whose waves are 64 both passes run and this port is what makes their values right.No action needed here — just the cross-reference.
@tippythetaidum on GitHub · 2026-11-26 10:27 UTC · original
@slauko, on the two refused programs: by name, neither is the face network.
victory shader-infoon the Series Xshaders.rpfgives:02384a60fda6f2d0:vfx_triangleClip:CS_DefragHeap_ComputeRelocations6b82bc7d22016cb5:vfx_triangleClip:CS_CollectTriangles_Meshlets2da4beb386509b77:alphaResolve:CS_AlphTransmissionPrefilterMipOn an RTX 5080 (Windows, native D3D12, also 32-lane only), all three were refused the same way in our 25 Nov build (fork
maind827419+ this PR + #1147 + #823). Faces still had skin in the café flashback and the cell. So a black head with the eyes and mouth floating needs another cause.One candidate that matches the symptom: HLVM04's finding on #923. With
VICTORY_TEXTURE_NO_WAIT=1, a skin texture can stay zero after the runtime remaps its memory, so the head goes black while the eyes and mouth (other textures) draw. Curry-976 confirmed it with an A/B on #1022. If your line runs withNO_WAIT=1, a run withVICTORY_TEXTURE_NO_WAIT=0would tell.AI-assisted (Claude Code, Claude Opus 5.5).
@Anzymanz on GitHub · 2026-11-26 12:26 UTC · original
A third AMD data point for the over-driven mouths that @UwUCammie and @bordersky describe, and what it is not, in case it saves someone time.
Setup: RX 9070 XT (RDNA 4), Mesa 26.3.1 RADV, GE-Proton11-14 with vkd3d-proton master, CachyOS. Tree: avatarmanz/VIctory-7900XTX main (9576c45f1) with bordersky's Linux fixes and this PR's six commits. Same result with the commits taken through bordersky's conflict resolution and with a hand port. Without this PR the mouths stay at rest. With it they move, but the upper lip lifts toward the nose and the teeth show, as in the diner dialogue described above.
Ruled out on our side (each checked on the card in the diner close-ups):
mainplus this PR, apart from a wave-wide 16-bit sum in 2 programs that comes from the base line;RADV_DEBUGwith them off, cold caches);The open question: every report of correct mouths I can find in this thread is from NVIDIA on Windows with native D3D12, and every report of over-driven mouths is from AMD under Proton. So vendor and platform are confounded. @avatarmanz, your tree runs on a 7900 XTX under Windows: if you have tried this PR's commits there, did the mouths look right? A report from NVIDIA under Wine with faces drawing would also settle it. That would tell us whether to look in RADV or in the Linux vkd3d-proton path.
AI-assisted (Claude Code, Claude Opus 5.5). Counts and hashes only; nothing from the game attached.
@Anzymanz on GitHub · 2026-11-26 13:07 UTC · original
@ThomasHFWright, a direct question, since your LinVxtory
faces-hairnotes put you on an RTX 5090 under Proton on CachyOS: have you run this PR's commits there with faces drawing, and if so, do the mouths move naturally, or over-drive (upper lip lifted toward the nose) the way they do on the three AMD cards under Proton above? That single data point would tell us whether the over-drive follows the vendor (RADV) or the platform (Wine/vkd3d-proton).AI-assisted (Claude Code, Claude Opus 5.5).
@tippythetaidum on GitHub · 2026-11-26 14:36 UTC · original
A native-Windows NVIDIA data point for the over-drive question, as a baseline (it can't split vendor from platform on its own, since both differ):
Setup: RTX 5080 (Blackwell, 32-lane only), Windows 11, native D3D12, no Wine. Tree: fork
maind827419+ this PR's commits + #1147 + #823 (our 25 Nov build). Series X, diagnostics build.Result: mouths move and look natural. I looked at the speaking close-ups among the captured frames (one frame in 96) of the diner and the counselor's office, the first ~3,300 frames of a 25-minute run:
None shows the upper lip lifted toward the nose or the teeth bared.
So over-drive doesn't appear on NVIDIA with native D3D12. Whether it follows RADV or vkd3d-proton still needs @ThomasHFWright's 5090-under-Proton run. If the 5090 under Proton over-drives, the platform is the likelier cause; if it doesn't, RADV is.
Caveat: these are sparse frames from a played run, not a targeted A/B of the diner dialogue. A visemes-heavy shot could still show it and I wouldn't have caught it.
AI-assisted (Claude Code, Claude Opus 5.5).
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.