light patch #633

Open
opened 2026-11-26 03:47:47 +00:00 by github-bot · 1 comment
Owner

@⁠joyawth on GitHub · 2026-11-25 03:30 UTC · original

TITLE
World scene renders and is lit with a small lower.rs patch (RTX 4060, 8 GB); remaining: 2 untranslated compute shaders, 7 refused host pipelines, texture residency stall
BODY
Setup
Windows 11 x64, RTX 4060 (8 GB VRAM),
victory at c96b4f2 (depth bounds commit) + the patch below
Title exe: game_scarlett_master.exe (Bink2Scarlett.dll, .rpf archives)
Run: victory.exe run game_scarlett_master.exe --execute (release build)
Summary
After pulling c96b4f2 the character and walls are no longer transparent. With the small patch below, 4 more pixel shaders translate and the opening world scene is lit (sun, haze, backlit character); before it was almost black and the host GPU was removed at the first world frame. Screenshots attached.

  1. Patch: a descriptor loaded only to read its size
    Four pixel shaders failed with a descriptor read only as data is not supported: e5b2121a02f4f741, 7d0f14ce44746d7e, 2fd01fca16993001, 6b6db9f1a526daeb.
    Disassembly of e5b2121a02f4f741: at 0x1c14 the shader does s_load_dwordx8 s[20:27] (an image descriptor picked with a dynamic index, param 288 + dynamic offset) and never samples it. It only decodes size fields by hand (width = dw1[30:31] | dw2[0:13]<<2, +1; height = dw2[14:27], +1; base level = dw3[12:15]), converts to float, v_rcp, * 264.0: a manual texture size query used to scale UVs. The samples (image_sample_l at 0x1c94) use other loads with other indices.
    In descriptor_data (lower.rs, ~line 5600) there is no instruction using this load as an image and no twin load, so use_at is None and it returns "a descriptor read only as data". The getDimensions reconstruction below it would work if a kind could be inferred. The patch (attached, ~15 lines):
    in the use_at None branch, after the existing special cases: if count == 8, set size_only = true and continue with (site, 0) instead of the Err;
    in the match &ui.fields that picks (props, image), add a first arm: _ if size_only => ((4 | u, 0x409), Some(4)).
    Caveat: it assumes a 2D texture; a slot that is not a 2D view would get wrong sizes. The patch was written with Claude's help from the disassembly and tested only on my PC (RTX 4060); it builds and runs fine there, but I have not checked other slots or GPUs.
    Result (14 min run): untranslated shaders 6 -> 2, no device removed (before: removed at about 2.5 min at the first world frame with 2222 draws and a 2.4 s submission), 4837 draws/frame in the scene with ~368 dropped without a host pipeline, about 2 fps (frames dominated by ~1 s of "preparing": 140-300 MB of copies and 50-100 MB copied back per frame; the GPU is busy 20-300 ms).
  2. Still failing
    Untranslated compute shaders:
    ceb5eb68cd99cb07 (1.4 KB): a min-reduction downsample (4 image_load per thread, LDS min tree, one image_store), looks like a depth-pyramid pass. Fails at 0x38 ("a descriptor's address or format read as data"): s_load_dwordx4 s[0:3] from a table entry then used as data at s_cmp_eq_u32 s2, 0.
    f133e35efed2a48a (169 KB, many SRVs and samplers): fails at 0x1eb4 (s_and_b64 vcc, exec, s[40:41] + s_cbranch_vccz, an any() over a lane mask while exec is partial) after every WAVE64-RETRY form (early-outs, skips, local waves) is exhausted.
    Host pipelines refused by D3D12 (Paramètre incorrect. (0x80070057)), almost certainly WaveSize(64) on a 32-lane NVIDIA GPU (lower.rs: "A host whose waves are at most 32 lanes (NVIDIA) refuses WaveSize(64)"):
    compute: 2da4beb386509b77, 369cbe906ea72764, 2cc4c197ee29e291, 02384a60fda6f2d0, 5dc3b25986622949, 6f225b641c5b0708
    mesh f5e50eb2108c425b with pixel ce3f0432a08f1d35
    VICTORY_WAVE_WIDE=1 changes nothing on this GPU (same refusals).
  3. Texture residency stalls at the card limit
    Over the 14 min run: 23739 textures uploaded (6351 MB), about 14000 waiting, and the counter stops moving ("textures picked by index: the card has no room for more; they wait"). On an 8 GB card some textures (for example the back of the character's jacket) stay at low quality. I understand room() stops at 90% of the system's budget on purpose.
    Other warnings seen
    a pipeline creation method that is not implemented: the title goes without this pipeline (29 times)
    a texture picked by index changed after its upload with nothing to tell of it: uploaded again (252 times)
    host view heap capped at N; views past it read a null slot
    a shader takes the address of a buffer view that is not there: it reads 0
    a dispatch without a host pipeline dropped
    I can run the diagnostics build and test patches if useful. I did not include any game files here, only hashes, offsets and instruction names.

size_only_texture.patch

Capture d'écran 2026-11-25 033347 Capture d'écran 2026-11-25 040402
**@⁠joyawth** on GitHub · 2026-11-25 03:30 UTC · [original](https://github.com/fxceless/victory-fork/issues/633) TITLE World scene renders and is lit with a small lower.rs patch (RTX 4060, 8 GB); remaining: 2 untranslated compute shaders, 7 refused host pipelines, texture residency stall BODY Setup Windows 11 x64, RTX 4060 (8 GB VRAM), victory at c96b4f2 (depth bounds commit) + the patch below Title exe: game_scarlett_master.exe (Bink2Scarlett.dll, .rpf archives) Run: `victory.exe run game_scarlett_master.exe --execute` (release build) Summary After pulling c96b4f2 the character and walls are no longer transparent. With the small patch below, 4 more pixel shaders translate and the opening world scene is lit (sun, haze, backlit character); before it was almost black and the host GPU was removed at the first world frame. Screenshots attached. 1. Patch: a descriptor loaded only to read its size Four pixel shaders failed with `a descriptor read only as data is not supported`: e5b2121a02f4f741, 7d0f14ce44746d7e, 2fd01fca16993001, 6b6db9f1a526daeb. Disassembly of e5b2121a02f4f741: at 0x1c14 the shader does `s_load_dwordx8 s[20:27]` (an image descriptor picked with a dynamic index, param 288 + dynamic offset) and never samples it. It only decodes size fields by hand (width = dw1[30:31] | dw2[0:13]<<2, +1; height = dw2[14:27], +1; base level = dw3[12:15]), converts to float, `v_rcp`, `* 264.0`: a manual texture size query used to scale UVs. The samples (`image_sample_l` at 0x1c94) use other loads with other indices. In `descriptor_data` (lower.rs, ~line 5600) there is no instruction using this load as an image and no twin load, so `use_at` is None and it returns "a descriptor read only as data". The `getDimensions` reconstruction below it would work if a kind could be inferred. The patch (attached, ~15 lines): in the `use_at` None branch, after the existing special cases: if `count == 8`, set `size_only = true` and continue with `(site, 0)` instead of the `Err`; in the `match &ui.fields` that picks `(props, image)`, add a first arm: `_ if size_only => ((4 | u, 0x409), Some(4))`. Caveat: it assumes a 2D texture; a slot that is not a 2D view would get wrong sizes. The patch was written with Claude's help from the disassembly and tested only on my PC (RTX 4060); it builds and runs fine there, but I have not checked other slots or GPUs. Result (14 min run): untranslated shaders 6 -> 2, no device removed (before: removed at about 2.5 min at the first world frame with 2222 draws and a 2.4 s submission), 4837 draws/frame in the scene with ~368 dropped without a host pipeline, about 2 fps (frames dominated by ~1 s of "preparing": 140-300 MB of copies and 50-100 MB copied back per frame; the GPU is busy 20-300 ms). 2. Still failing Untranslated compute shaders: ceb5eb68cd99cb07 (1.4 KB): a min-reduction downsample (4 image_load per thread, LDS min tree, one image_store), looks like a depth-pyramid pass. Fails at 0x38 ("a descriptor's address or format read as data"): `s_load_dwordx4 s[0:3]` from a table entry then used as data at `s_cmp_eq_u32 s2, 0`. f133e35efed2a48a (169 KB, many SRVs and samplers): fails at 0x1eb4 (`s_and_b64 vcc, exec, s[40:41]` + `s_cbranch_vccz`, an any() over a lane mask while exec is partial) after every WAVE64-RETRY form (early-outs, skips, local waves) is exhausted. Host pipelines refused by D3D12 (`Paramètre incorrect. (0x80070057)`), almost certainly `WaveSize(64)` on a 32-lane NVIDIA GPU (lower.rs: "A host whose waves are at most 32 lanes (NVIDIA) refuses WaveSize(64)"): compute: 2da4beb386509b77, 369cbe906ea72764, 2cc4c197ee29e291, 02384a60fda6f2d0, 5dc3b25986622949, 6f225b641c5b0708 mesh f5e50eb2108c425b with pixel ce3f0432a08f1d35 `VICTORY_WAVE_WIDE=1` changes nothing on this GPU (same refusals). 3. Texture residency stalls at the card limit Over the 14 min run: 23739 textures uploaded (6351 MB), about 14000 waiting, and the counter stops moving ("textures picked by index: the card has no room for more; they wait"). On an 8 GB card some textures (for example the back of the character's jacket) stay at low quality. I understand `room()` stops at 90% of the system's budget on purpose. Other warnings seen `a pipeline creation method that is not implemented: the title goes without this pipeline` (29 times) `a texture picked by index changed after its upload with nothing to tell of it: uploaded again` (252 times) `host view heap capped at N; views past it read a null slot` `a shader takes the address of a buffer view that is not there: it reads 0` `a dispatch without a host pipeline dropped` I can run the diagnostics build and test patches if useful. I did not include any game files here, only hashes, offsets and instruction names. [size_only_texture.patch](https://github.com/user-attachments/files/35391682/size_only_texture.patch) <img width="1919" height="1079" alt="Capture d&#39;écran 2026-11-25 033347" src="https://github.com/user-attachments/assets/c3735ce1-efb0-41a6-9fbf-d5be426c4d37" /> <img width="1904" height="1064" alt="Capture d&#39;écran 2026-11-25 040402" src="https://github.com/user-attachments/assets/690af871-313b-4059-8111-4fc08ef42c3a" />
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:47:47 +00:00
Author
Owner

@⁠ArturoWolff on GitHub · 2026-11-25 04:31 UTC · original

The attached patch says the size-only lookup assumes a 2D texture, but it emits a 3D texture handle. I checked this independently of the screenshot: on 310c6eb I applied your attachment, lowered the synthetic WATERFALL_SIZE_ONLY_WAVE32 input from #81 on Linux, and disassembled the emitted DXIL with Microsoft dxc -dumpbin. The handle passed to getDimensions was annotated Texture3D<4xF32> (kind 4). Changing just ((4 | u, 0x409), Some(4)) to ((2 | u, 0x409), Some(2)) in the size_only arm and repeating the same test yielded Texture2D<4xF32> (kind 2).

PR #81 already takes the 2D approach on a narrower fallback: it excludes known non-SRV ranges. I'd compare against that rather than stack both patches. This verifies the emitted type, not the actual type of every title slot or what lit the room. If you rerun the visual A/B, keeping the save and other switches fixed and ensuring each variant rebuilds those shader entries would make it much easier to interpret.

AI disclosure: Hermes Agent ran the synthetic shader comparison and wrote this comment on ArturoWolff’s behalf.

**@⁠ArturoWolff** on GitHub · 2026-11-25 04:31 UTC · [original](https://github.com/fxceless/victory-fork/issues/633#issuecomment-7152914602) The attached patch says the size-only lookup assumes a **2D** texture, but it emits a **3D** texture handle. I checked this independently of the screenshot: on `310c6eb` I applied your attachment, lowered the synthetic `WATERFALL_SIZE_ONLY_WAVE32` input from #81 on Linux, and disassembled the emitted DXIL with Microsoft `dxc -dumpbin`. The handle passed to `getDimensions` was annotated `Texture3D<4xF32>` (kind 4). Changing just `((4 | u, 0x409), Some(4))` to `((2 | u, 0x409), Some(2))` in the `size_only` arm and repeating the same test yielded `Texture2D<4xF32>` (kind 2). [PR #81](https://git.gtahub.st/github/fxceless--victory-fork/pulls/81) already takes the 2D approach on a narrower fallback: it excludes known non-SRV ranges. I'd compare against that rather than stack both patches. This verifies the emitted type, not the actual type of every title slot or what lit the room. If you rerun the visual A/B, keeping the save and other switches fixed and ensuring each variant rebuilds those shader entries would make it much easier to interpret. AI disclosure: Hermes Agent ran the synthetic shader comparison and wrote this comment on ArturoWolff’s behalf.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/fxceless--victory-fork#633
No description provided.