descriptor: place title view slots past a capped (NVIDIA) host heap through a table #638

Closed
chemist6913 wants to merge 2 commits from upstream-pr/638 into main
chemist6913 commented 2026-11-28 02:19:44 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by chemist6913 on 2026-11-28T02:19:44Z.


Summary

On NVIDIA, the host's shader-visible view heap is capped at 1,000,000 descriptors. An RTX 5090 on driver 621.40 refuses 1,000,001 and every larger size. The retail game's view heap has 1,245,184 slots.

HostHeap::new therefore kept title slots 0..737,855 one to one and left the rest out. Slots 737,855..999,998 hold the dynamic tables and slot 999,999 is the null slot. Every shader-computed (bindless) view index past 737,855 read the null slot, or one of the host's own dynamic slots. Tables were fine, because draws copy those into dynamic slots. The code already said "a title that reaches them needs remapping". This PR adds that remap. Details are in #545.

How the game uses its heap: it keeps 400,000–570,000 views past slot 65,536 at once, spread over the whole heap, and turns over about 130,000 a second. Because the views are spread out, a fold (slot mod N) can't keep them apart.

Change

Host side (descriptor/host.rs, Places). On a host whose view heap is capped at PORTABLE_VIEWS, with VICTORY_VIEW_REMAP not 0:

  • Bookkeeping stays in title-slot numbers. The heap's count is now the title's full count, and dynamic slot k is index count + k, as on uncapped (AMD) hosts.
  • Only the place a descriptor is written to is mapped:
    • title slots below 65,536 stay where they are;
    • each title slot from 65,536 on takes a place from a pool of 672,318 when a descriptor is written into it;
    • dynamic slots map linearly after the pool;
    • everything else maps to the null place.
  • A slot gives its place back when it is made null (unmake, make_null, and buffer views left null to wait for a draw). Places are reused oldest-first. If the pool is ever empty, the write goes to a sink place that no index reads, and a warning is logged once.
  • cpu(index) maps through this; cpu_at(place) is the raw handle (used by fill_null); gpu_handle maps too.
  • The strides upload buffer doubles in size. Dword SLOT_STRIDES_COUNT + i holds the place of view index i, and is written when a place is given or given back.

Translator side (emit/shader.rs). With set_view_remap(true):

  • the view limit becomes SLOT_STRIDES_COUNT - 1;
  • heap_handle_at clamps the index as before, then reads its place from that dword, through SLOT_STRIDES if the shader binds it, else SLOT_TABLE_STRIDES, so the heap buffer sweep isn't started by this.
  • Samplers and raw-twin indices are unchanged.

The remap flag is part of the shader cache key (mod.rs) and of host_settings (bit 31 of the limit). victory translate --warm takes VICTORY_VIEW_REMAP=1 alongside VICTORY_VIEW_LIMIT=2097151, to warm for such a host.

Hosts that take bigger heaps (AMD) are unchanged: view_remap() stays false.

Testing

On RTX 5090, Series X profile, 1440p, opening cutscene through the diner, about 15 runs of 90–110 s.

  • Picture: unchanged, and no device removal.
  • Pool: after the world loads, at least about 106,000 places stay free while the give-back of null buffer slots is missing, and about 445,000 with it. It never ran out.
  • Rejected first attempt: an earlier version pooled only from slot 672,319 on (65,536 places). It ran out 33 s in and broke the picture, which is why the pool now starts at 65,536.
  • Builds and tests on this branch:
    • cargo check -p victory --features diagnostics: clean.
    • cargo test -p victory-gpu: 441 passed, 2 failed.
    • cargo test -p victory-shader: 287 passed, 3 failed.
    • The 5 failures fail the same way on unmodified main here: indirect::tests::host_list_budget_starts_empty_at_each_submission, indirect::tests::warp_batch_charges_every_execution, two emit::rect tests and one hardware barycentric test.
  • Ported: the code was written and run on an older base, then ported to current main. The game runs above were on that older base, not on this branch.

Not measured: frame rate. Every view-heap handle now costs one more raw-buffer load, usually uniform. A before/after on another NVIDIA card would be welcome.

Not fixed by this: the phone screen in the diner (#545). That turned out to be an exposure issue, and the findings are in the issue.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5535753692 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638). Originally posted by [chemist6913](https://github.com/chemist6913) on 2026-11-28T02:19:44Z. --- ## Summary On NVIDIA, the host's shader-visible view heap is capped at 1,000,000 descriptors. An RTX 5090 on driver 621.40 refuses 1,000,001 and every larger size. The retail game's view heap has 1,245,184 slots. `HostHeap::new` therefore kept title slots 0..737,855 one to one and left the rest out. Slots 737,855..999,998 hold the dynamic tables and slot 999,999 is the null slot. Every shader-computed (bindless) view index past 737,855 read the null slot, or one of the host's own dynamic slots. Tables were fine, because draws copy those into dynamic slots. The code already said "a title that reaches them needs remapping". This PR adds that remap. Details are in #545. **How the game uses its heap:** it keeps 400,000–570,000 views past slot 65,536 at once, spread over the whole heap, and turns over about 130,000 a second. Because the views are spread out, a fold (slot mod N) can't keep them apart. ## Change **Host side (`descriptor/host.rs`, `Places`).** On a host whose view heap is capped at `PORTABLE_VIEWS`, with `VICTORY_VIEW_REMAP` not `0`: - Bookkeeping stays in title-slot numbers. The heap's `count` is now the title's full count, and dynamic slot `k` is index `count + k`, as on uncapped (AMD) hosts. - Only the place a descriptor is written to is mapped: - title slots below 65,536 stay where they are; - each title slot from 65,536 on takes a place from a pool of 672,318 when a descriptor is written into it; - dynamic slots map linearly after the pool; - everything else maps to the null place. - A slot gives its place back when it is made null (`unmake`, `make_null`, and buffer views left null to wait for a draw). Places are reused oldest-first. If the pool is ever empty, the write goes to a sink place that no index reads, and a warning is logged once. - `cpu(index)` maps through this; `cpu_at(place)` is the raw handle (used by `fill_null`); `gpu_handle` maps too. - The strides upload buffer doubles in size. Dword `SLOT_STRIDES_COUNT + i` holds the place of view index `i`, and is written when a place is given or given back. **Translator side (`emit/shader.rs`).** With `set_view_remap(true)`: - the view limit becomes `SLOT_STRIDES_COUNT - 1`; - `heap_handle_at` clamps the index as before, then reads its place from that dword, through `SLOT_STRIDES` if the shader binds it, else `SLOT_TABLE_STRIDES`, so the heap buffer sweep isn't started by this. - Samplers and raw-twin indices are unchanged. The remap flag is part of the shader cache key (`mod.rs`) and of `host_settings` (bit 31 of the limit). `victory translate --warm` takes `VICTORY_VIEW_REMAP=1` alongside `VICTORY_VIEW_LIMIT=2097151`, to warm for such a host. Hosts that take bigger heaps (AMD) are unchanged: `view_remap()` stays false. ## Testing On RTX 5090, Series X profile, 1440p, opening cutscene through the diner, about 15 runs of 90–110 s. - **Picture:** unchanged, and no device removal. - **Pool:** after the world loads, at least about 106,000 places stay free while the give-back of null buffer slots is missing, and about 445,000 with it. It never ran out. - **Rejected first attempt:** an earlier version pooled only from slot 672,319 on (65,536 places). It ran out 33 s in and broke the picture, which is why the pool now starts at 65,536. - **Builds and tests on this branch:** - `cargo check -p victory --features diagnostics`: clean. - `cargo test -p victory-gpu`: 441 passed, 2 failed. - `cargo test -p victory-shader`: 287 passed, 3 failed. - The 5 failures fail the same way on unmodified `main` here: `indirect::tests::host_list_budget_starts_empty_at_each_submission`, `indirect::tests::warp_batch_charges_every_execution`, two `emit::rect` tests and one hardware barycentric test. - **Ported:** the code was written and run on an older base, then ported to current `main`. The game runs above were on that older base, not on this branch. Not measured: frame rate. Every view-heap handle now costs one more raw-buffer load, usually uniform. A before/after on another NVIDIA card would be welcome. Not fixed by this: the phone screen in the diner (#545). That turned out to be an exposure issue, and the findings are in the issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ArturoWolff commented 2026-11-28 02:46:37 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ArturoWolff on 2026-11-28T02:46:37Z.


Additional NVIDIA card comparison as requested. Tested your exact PR head b0228f071a4effcc516a3baebec5ef62704791d2 (base a4d05e7fd0af904130809c334a6008d62c24db6a) on an RTX 4060 desktop 8 GB / 16 GB system RAM, Linux, NVIDIA 620.73.04, GE-Proton11-14 / vkd3d-proton 3.2.0 (cae8353ed7959c4+). Both arms use the same locked MSVC release executable, with the previously tested Linux compiler, pipeline-library and physical-backing compatibility integrations retained unchanged (patch SHA-256 a9143500aeb8611e66f90130534831f8f02156299e3133f970224ef50e7ae919, provenance and baseline in #628).

Both actual retail launches used identical cloned profile seed, fresh engine/driver caches, Series X 1080to1440, full requested RT/water passes, no explicit omitted shaders or Bink skip, full write-back and waits, DLSS/FG off for the comparison, same DXC 1.9.2609 and mixed 448 MiB backing allowance. Effective logged graphics settings differed only in VICTORY_VIEW_REMAP.

Observation Remap 0 (old behavior) Remap 1
Capped heap / null-slot warning 1 0
Table remap initialization absent yes
Pool exhaustion warnings 0 0
Minimum sampled host available RAM (MiB) 1,409 1,558
Elapsed including startup (s) 138.42 137.17
Actual title exit 5 5

Enabled arm logged title_slots=1245184 as_is=65536 pool=672318 dynamic_at=737855, and the table was selected from the first shader. Both arms had two successful DXC fallback attempts, no missing clamp/compare/native-library warnings, one unsupported Wave64 translation, and no host guard stop, new OOM kills or kernel GPU faults. Temporary backing retired empty. Both visually reached loading artwork then a black FPS overlay; no recorded input or live world. Both still fail during the same first-story prestream phase described in #628.

This confirms activation of the intended remap path on an 8 GB RTX 4060 under Proton, but does not establish in-world descriptor correctness, reuse safety, peak pool occupancy, or gameplay FPS. It also does not fix this particular loading failure. The new watchdog findings in #628 make normal GPU completion and synchronization a more useful next investigation than removing rendering features. Thanks for making this independently selectable.

AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232586610 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638#issuecomment-7232586610). Originally posted by [ArturoWolff](https://github.com/ArturoWolff) on 2026-11-28T02:46:37Z. --- Additional NVIDIA card comparison as requested. Tested your exact PR head `b0228f071a4effcc516a3baebec5ef62704791d2` (base `a4d05e7fd0af904130809c334a6008d62c24db6a`) on an RTX 4060 desktop 8 GB / 16 GB system RAM, Linux, NVIDIA 620.73.04, GE-Proton11-14 / vkd3d-proton 3.2.0 (`cae8353ed7959c4+`). Both arms use the same locked MSVC release executable, with the previously tested Linux compiler, pipeline-library and physical-backing compatibility integrations retained unchanged (patch SHA-256 `a9143500aeb8611e66f90130534831f8f02156299e3133f970224ef50e7ae919`, provenance and baseline in [#628](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/628#issuecomment-7232468166)). Both actual retail launches used identical cloned profile seed, fresh engine/driver caches, Series X `1080to1440`, full requested RT/water passes, no explicit omitted shaders or Bink skip, full write-back and waits, DLSS/FG off for the comparison, same DXC 1.9.2609 and mixed 448 MiB backing allowance. Effective logged graphics settings differed only in `VICTORY_VIEW_REMAP`. | Observation | Remap 0 (old behavior) | Remap 1 | |---|---:|---:| | Capped heap / null-slot warning | 1 | 0 | | Table remap initialization | absent | yes | | Pool exhaustion warnings | 0 | 0 | | Minimum sampled host available RAM (MiB) | 1,409 | 1,558 | | Elapsed including startup (s) | 138.42 | 137.17 | | Actual title exit | 5 | 5 | Enabled arm logged `title_slots=1245184 as_is=65536 pool=672318 dynamic_at=737855`, and the table was selected from the first shader. Both arms had two successful DXC fallback attempts, no missing clamp/compare/native-library warnings, one unsupported Wave64 translation, and no host guard stop, new OOM kills or kernel GPU faults. Temporary backing retired empty. Both visually reached loading artwork then a black FPS overlay; no recorded input or live world. Both still fail during the same first-story prestream phase described in #628. This confirms activation of the intended remap path on an 8 GB RTX 4060 under Proton, but does not establish in-world descriptor correctness, reuse safety, peak pool occupancy, or gameplay FPS. It also does not fix this particular loading failure. The new watchdog findings in #628 make normal GPU completion and synchronization a more useful next investigation than removing rendering features. Thanks for making this independently selectable. AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
jessebuffington commented 2026-11-28 03:20:27 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jessebuffington on 2026-11-28T03:20:27Z.


Tested on an RTX 2060 6 GB (Linux, Proton Experimental, Series S profile, DLSS off) against the intro-prestream crash in #628. The remap was active (title slots from 65536 on are placed in a pool of 672318, and no more views past it read a null slot), and the picture was fine up to the stall. But the crash is unchanged: frames stop as FSR 4 starts with the first story cutscene, and the title's watchdog fires about 95 s later. So #638 doesn't fix #628 on this setup. Details and logs are in #628.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232993993 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638#issuecomment-7232993993). Originally posted by [jessebuffington](https://github.com/jessebuffington) on 2026-11-28T03:20:27Z. --- Tested on an RTX 2060 6 GB (Linux, Proton Experimental, Series S profile, DLSS off) against the intro-prestream crash in #628. The remap was active (title slots from 65536 on are placed in a pool of 672318, and no more views past it read a null slot), and the picture was fine up to the stall. But the crash is unchanged: frames stop as FSR 4 starts with the first story cutscene, and the title's watchdog fires about 95 s later. So #638 doesn't fix #628 on this setup. Details and logs are in #628.
Machad3x commented 2026-11-28 06:11:51 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Machad3x on 2026-11-28T06:11:51Z.


Test results for this PR on our fork. It is cherry-picked as-is and switched on with VICTORY_VIEW_REMAP=1, together with the RT fault-page keep, the slot-fresh check and the unseen-writes rotation.

Setup: RTX 3080 Ti, driver 621.40, Windows 11 Pro build 26300, Ryzen 7 5700X. RT on (VICTORY_BVH_BUILDER=1). Each run is 240 s on the opening interior scene, with a valid (non-compile) rerun. Values are averages over the last 120 s.

Run VIEW_REMAP Frame Preparing GPU
lt1b-2 off 66.6 ms (max 80.6) 46.8 8.3
lt1c-2 on 113.5 ms (max 162.4) 69.6 28.4
  • Counters (on): about 24.8k view places are given and about 24.8k given back per frame, with 232.9k in use. There are 0 writes that found no free place, so no view reads null.
  • Picture: no visible change in the dark-interior case (#545 / A5). Indirect light was still missing with the remap on and a warm cache.
  • Lit run: one run with the remap on was lit, but it was still compiling pipelines at about 1000 ms per frame. Other slow-frame runs without the remap were lit too, so we do not credit the light to this PR.
  • Shaders and draws: 0 shaders or pipelines refused, and 0 draws dropped in the valid runs.

Log excerpt (on, one 5 s line):

victory_gpu::descriptor: view places per frame (VICTORY_VIEW_REMAP=1): 24813 given, 24780 given back, 0 writes that found none free (they read null); 232888 in use

The cost seems to come from giving places back and taking them again every frame. Reusing a place while the view's record is unchanged would likely remove most of the +23 ms preparing and +20 ms GPU. The switch stays off by default on our side.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7235141577 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638#issuecomment-7235141577). Originally posted by [Machad3x](https://github.com/Machad3x) on 2026-11-28T06:11:51Z. --- Test results for this PR on our fork. It is cherry-picked as-is and switched on with `VICTORY_VIEW_REMAP=1`, together with the RT fault-page keep, the slot-fresh check and the unseen-writes rotation. **Setup:** RTX 3080 Ti, driver 621.40, Windows 11 Pro build 26300, Ryzen 7 5700X. RT on (`VICTORY_BVH_BUILDER=1`). Each run is 240 s on the opening interior scene, with a valid (non-compile) rerun. Values are averages over the last 120 s. | Run | `VIEW_REMAP` | Frame | Preparing | GPU | |---|---|---|---|---| | lt1b-2 | off | 66.6 ms (max 80.6) | 46.8 | 8.3 | | lt1c-2 | on | 113.5 ms (max 162.4) | 69.6 | 28.4 | - **Counters (on):** about 24.8k view places are given and about 24.8k given back per frame, with 232.9k in use. There are 0 writes that found no free place, so no view reads null. - **Picture:** no visible change in the dark-interior case (#545 / A5). Indirect light was still missing with the remap on and a warm cache. - **Lit run:** one run with the remap on was lit, but it was still compiling pipelines at about 1000 ms per frame. Other slow-frame runs without the remap were lit too, so we do not credit the light to this PR. - **Shaders and draws:** 0 shaders or pipelines refused, and 0 draws dropped in the valid runs. Log excerpt (on, one 5 s line): ``` victory_gpu::descriptor: view places per frame (VICTORY_VIEW_REMAP=1): 24813 given, 24780 given back, 0 writes that found none free (they read null); 232888 in use ``` The cost seems to come from giving places back and taking them again every frame. Reusing a place while the view's record is unchanged would likely remove most of the +23 ms preparing and +20 ms GPU. The switch stays off by default on our side.
bigboss22869 commented 2026-11-28 20:54:00 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by bigboss22869 on 2026-11-28T20:54:00Z.


A small follow-up this PR could carry, for the frame replay tool.

With the places table on, victory replay <capture> --retranslate <folder> still translates as for a host without it, so shaders retranslated for a capture of an NVIDIA run do not match the capture's own (their view indices are not placed). On my fork I added a switch for it in apps/victory/src/replay.rs, next to VICTORY_HOST_WAVE:

    // (`VICTORY_HOST_VIEW_REMAP=1`: as for a host whose view heaps hold fewer views than the
    // title's, with the indices placed through a table: an NVIDIA run with `VICTORY_VIEW_REMAP`.)
    if std::env::var_os("VICTORY_HOST_VIEW_REMAP").is_some_and(|v| v == "1") {
        victory_shader::emit::set_view_remap(true);
        victory_shader::emit::set_view_heap_limit(victory_shader::emit::SLOT_STRIDES_COUNT - 1);
    }

With VICTORY_HOST_WAVE=32 VICTORY_HOST_VIEW_REMAP=1, a retranslated set replays a capture from an RTX 5070 Ti with the same picture as the capture's own shaders (71 dB against the recorded frame both ways). That makes --compare --shaders ... --shaders-b ... usable on NVIDIA for comparing translation forms on the card.

It cannot be a PR against main on its own, since set_view_remap comes with this PR. Feel free to take it in here; otherwise I can open it once this one is merged. The commit is in https://github.com/bigboss22869/VIctory-RTX5070Ti (branch rtx5070ti, 42961750).

A data point for the PR itself: it has run here all day on an RTX 5070 Ti 16 GB (Windows 11, Series X profile, 1440p), 81 scripted runs and several play sessions, with no "no free place for a title view slot" warning and no device removal in the logs.

AI-assisted (Claude Code); the runs are mine.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7245625096 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638#issuecomment-7245625096). Originally posted by [bigboss22869](https://github.com/bigboss22869) on 2026-11-28T20:54:00Z. --- A small follow-up this PR could carry, for the frame replay tool. With the places table on, `victory replay <capture> --retranslate <folder>` still translates as for a host without it, so shaders retranslated for a capture of an NVIDIA run do not match the capture's own (their view indices are not placed). On my fork I added a switch for it in `apps/victory/src/replay.rs`, next to `VICTORY_HOST_WAVE`: ```rust // (`VICTORY_HOST_VIEW_REMAP=1`: as for a host whose view heaps hold fewer views than the // title's, with the indices placed through a table: an NVIDIA run with `VICTORY_VIEW_REMAP`.) if std::env::var_os("VICTORY_HOST_VIEW_REMAP").is_some_and(|v| v == "1") { victory_shader::emit::set_view_remap(true); victory_shader::emit::set_view_heap_limit(victory_shader::emit::SLOT_STRIDES_COUNT - 1); } ``` With `VICTORY_HOST_WAVE=32 VICTORY_HOST_VIEW_REMAP=1`, a retranslated set replays a capture from an RTX 5070 Ti with the same picture as the capture's own shaders (71 dB against the recorded frame both ways). That makes `--compare --shaders ... --shaders-b ...` usable on NVIDIA for comparing translation forms on the card. It cannot be a PR against `main` on its own, since `set_view_remap` comes with this PR. Feel free to take it in here; otherwise I can open it once this one is merged. The commit is in https://github.com/bigboss22869/VIctory-RTX5070Ti (branch `rtx5070ti`, `42961750`). A data point for the PR itself: it has run here all day on an RTX 5070 Ti 16 GB (Windows 11, Series X profile, 1440p), 81 scripted runs and several play sessions, with no "no free place for a title view slot" warning and no device removal in the logs. AI-assisted (Claude Code); the runs are mine.
futurepro62 commented 2026-11-29 01:35:53 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by futurepro62 on 2026-11-29T01:35:53Z.


A before/after on another NVIDIA card, as asked: RTX 5070 Ti (16 GB), Windows 11 26300, Series X profile, 4K output, DLSS Performance, frame generation 4x.

Result: with this PR the game was unplayable. In the world it sat at about 2 fps (frames of 440–490 ms) for over 20 seconds at a time. Without it, on the same build, it runs at about 18–20 fps. The remap itself worked: the log shows title slots from 65536 on are placed in a pool of 672318, and no pool-exhaustion warning appeared.

The cost is on the CPU, not the card. Per-frame lines from the two sessions, first minutes in the world:

Without #638 With #638
list calls translated per frame (VICTORY_THIN line) ~46,000 ~22,000
time translating them (all threads) ~260 ms ~700–880 ms
per call ~6 µs ~35 µs
title threads waiting at presents ~11 ms ~240 ms
frame time (median) ~45 ms ~460 ms
waiting for the card (settles line) ~2 ms 1–4 ms

So each translated list call costs about 6 times more with the remap. My guess is the host-side place mapping on every descriptor write: the title writes about 15,000–20,000 view slots a frame, and up to about 47,000 in the slow stretch (writes of view slots per frame). That's not measured per function.

Caveats:

  • About one minute in the world, in a different spot from the session without it. But a 6x per-call cost seems too large for the location to explain.
  • The base was not current main. It was the fork's main from earlier today, plus #339, #348 (with the fallback-order fix posted there), and a port of Marvisak/VIctory#3619. #638 merged onto it without conflicts.
  • Because the frame rate made the game unplayable, I couldn't check whether the black props it targets were fixed.

The base build is the same on both sides, and this PR was the only change between the two sessions. Rolled back for now. Happy to run a build with timing around Places if that helps.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7248888420 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638#issuecomment-7248888420). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-29T01:35:53Z. --- A before/after on another NVIDIA card, as asked: RTX 5070 Ti (16 GB), Windows 11 26300, Series X profile, 4K output, DLSS Performance, frame generation 4x. **Result:** with this PR the game was unplayable. In the world it sat at about 2 fps (frames of 440–490 ms) for over 20 seconds at a time. Without it, on the same build, it runs at about 18–20 fps. The remap itself worked: the log shows `title slots from 65536 on are placed in a pool of 672318`, and no pool-exhaustion warning appeared. **The cost is on the CPU, not the card.** Per-frame lines from the two sessions, first minutes in the world: | | Without #638 | With #638 | |---|---|---| | list calls translated per frame (`VICTORY_THIN` line) | ~46,000 | ~22,000 | | time translating them (all threads) | ~260 ms | ~700–880 ms | | per call | ~6 µs | ~35 µs | | title threads waiting at presents | ~11 ms | ~240 ms | | frame time (median) | ~45 ms | ~460 ms | | waiting for the card (`settles` line) | ~2 ms | 1–4 ms | So each translated list call costs about 6 times more with the remap. My guess is the host-side place mapping on every descriptor write: the title writes about 15,000–20,000 view slots a frame, and up to about 47,000 in the slow stretch (`writes of view slots per frame`). That's not measured per function. **Caveats:** - About one minute in the world, in a different spot from the session without it. But a 6x per-call cost seems too large for the location to explain. - The base was not current `main`. It was the fork's `main` from earlier today, plus #339, #348 (with the fallback-order fix posted there), and a port of Marvisak/VIctory#3619. #638 merged onto it without conflicts. - Because the frame rate made the game unplayable, I couldn't check whether the black props it targets were fixed. The base build is the same on both sides, and this PR was the only change between the two sessions. Rolled back for now. Happy to run a build with timing around `Places` if that helps. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
futurepro62 commented 2026-11-29 03:18:40 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by futurepro62 on 2026-11-29T03:18:40Z.


Correction to my report above: with a longer run, this PR is playable here. The "about 2 fps / unplayable" result came from a session with only about 1.5 minutes in the world, dominated by the spikes right after loading. I shouldn't have called it unplayable from that.

Same card (RTX 5070 Ti 16 GB, Series X profile, 4K output, DLSS Performance, frame generation 4x). Medians and means over the in-world frame-time and VICTORY_THIN lines:

Session In the world Per list call Median frame Mean frame
Without this PR (long session) ~75 min ~5.8 µs 71 ms 72 ms
With this PR, first try (reported above) ~1.5 min ~19 µs 71 ms 200 ms
With this PR, second try ~4 min ~9.9 µs 71 ms 91 ms

The 71 ms median is the frame-generation pacing on this setup, so the median matches the build without the PR. The cost shows in the per-call time and the mean.

The second run was on an exe whose pipelines had not been made ahead (victory warm), so part of that cost is pipeline compiles during play. In a CPU profile of 60 s of it (ETW, symbols from the PDB), HostPipeline::new and the driver's compiler took about 14.5% of the busy CPU time. The PR's own code barely shows: HostHeap::place_back about 0.6% and HostHeap::cpu about 0.7%. All contended mutexes together were under 2%. The largest share, about 35%, is list translation (list::thin::Recording::run, mostly draw::State::bind), which isn't specific to this PR.

Picture:

  • The props that are black from the first frame of the opening scene (towel hooks, the items on a bathroom shelf, the soap dish) were still black with this PR. So on this card they are not caused by the view-heap cap, and my follow-up idea about that was wrong. I haven't posted it.
  • While driving, the player saw clearly fewer graphical problems than without the PR. That's an impression, not measured.

I'm keeping it in my build for now and will report more after longer play with warmed pipelines.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7249970245 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638#issuecomment-7249970245). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-29T03:18:40Z. --- **Correction to my report above:** with a longer run, this PR is playable here. The "about 2 fps / unplayable" result came from a session with only about 1.5 minutes in the world, dominated by the spikes right after loading. I shouldn't have called it unplayable from that. Same card (RTX 5070 Ti 16 GB, Series X profile, 4K output, DLSS Performance, frame generation 4x). Medians and means over the in-world frame-time and `VICTORY_THIN` lines: | Session | In the world | Per list call | Median frame | Mean frame | |---|---|---|---|---| | Without this PR (long session) | ~75 min | ~5.8 µs | 71 ms | 72 ms | | With this PR, first try (reported above) | ~1.5 min | ~19 µs | 71 ms | 200 ms | | **With this PR, second try** | ~4 min | ~9.9 µs | **71 ms** | 91 ms | The 71 ms median is the frame-generation pacing on this setup, so the median matches the build without the PR. The cost shows in the per-call time and the mean. The second run was on an exe whose pipelines had not been made ahead (`victory warm`), so part of that cost is pipeline compiles during play. In a CPU profile of 60 s of it (ETW, symbols from the PDB), `HostPipeline::new` and the driver's compiler took about 14.5% of the busy CPU time. The PR's own code barely shows: `HostHeap::place_back` about 0.6% and `HostHeap::cpu` about 0.7%. All contended mutexes together were under 2%. The largest share, about 35%, is list translation (`list::thin::Recording::run`, mostly `draw::State::bind`), which isn't specific to this PR. **Picture:** - The props that are black from the first frame of the opening scene (towel hooks, the items on a bathroom shelf, the soap dish) were **still black** with this PR. So on this card they are not caused by the view-heap cap, and my follow-up idea about that was wrong. I haven't posted it. - While driving, the player saw clearly fewer graphical problems than without the PR. That's an impression, not measured. I'm keeping it in my build for now and will report more after longer play with warmed pipelines. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
futurepro62 commented 2026-11-29 03:26:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by futurepro62 on 2026-11-29T03:26:42Z.


Method for my two reports above, so they can be checked and repeated.

Hardware and settings

RTX 5070 Ti 16 GB, Windows 11 26300, shaders.rpf of 1.0.2.1. Launched with the fork's PLAY_FRAMEGEN.cmd mode 6 (Series X profile, big pools, High priority), with the F1 menu's saved choices on top: 4K output, DLSS Performance, DLSS frame generation 4x.

Builds (all on fork main 9300875 from 2026-11-28)

Build Contents Used for
with #638 103661a #339 (e8e2dfc), #348 at 5df24f4 plus a local fallback-order fix cb325c5 (posted in #348), this PR at b0228f0 both runs with this PR
without #638 1f10565 the same, minus this PR, plus a port of Marvisak/VIctory#3619 (atomic-sub loops on NVIDIA; changes one compute program, weatherParticle:CS_BeginUpdate) the baseline

Confound: the baseline has the #3619 port and the builds with this PR don't. It changes a single weather-particle program.

Runs and switches

Run Log In the world Launcher differences
Baseline victory-nvidia-20261128-154834.log ~75 min VICTORY_SLOT_EVICT=1 at its default 85%
With #638, first ...-153204.log ~1.7 min same as baseline
With #638, second ...-190912.log ~4 min VICTORY_SLOT_EVICT_PERCENT=78; victory warm not run for this exe, so pipelines were compiled during play

The baseline and the second #638 run were in different places in the game.

How the numbers were computed (from the logs, VICTORY_LOG=warn plus the default info lines)

  • Frame time: the victory_gpu::frame_times lines (one per few seconds). "In the world" means windows whose median is over 20 ms (menus and loading run faster). I report the median and mean of those window medians. These are the game's own frames, before frame generation: 71.4 ms is the pacing on this setup, about 14 game fps (56 shown with 4x frame generation), so the median hides differences and the mean shows them.
  • Per list call: the list calls translated by threads of ours per frame: N in T ms lines. Over windows with N > 20,000: sum of T divided by sum of N. T is summed over all threads.

CPU profile (second run, 60 s while driving)

  1. wpr -start CPU -filemode, elevated (samply's own recorder needs xperf, which isn't installed), then 60 s later wpr -stop game.etl. That gave 3.8 GB.
  2. samply import game.etl --save-only -o prof.json.gz (samply 0.13.1).
  3. A script (gist) charges every sample of the victory.exe process to the nearest victory.exe frame on its stack. So time inside ntdll, D3D12 or the driver counts toward the function that called it. It resolves addresses with dbghelp.dll against the build's own PDB, and drops samples whose nearest frame is a wait (Condvar::wait, park, sleep). Percentages are of the remaining "busy" samples: 693,151 of 2,217,780.

Results from that: list::thin::Recording::run 34.5% (of it draw::State::bind 25.7%), HostPipeline::new 14.5% (compiles, because the exe wasn't warmed), HostHeap::place_back 0.6% and HostHeap::cpu 0.7% self time, and all contended mutexes under 2%.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7250051185 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638#issuecomment-7250051185). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-29T03:26:42Z. --- **Method for my two reports above**, so they can be checked and repeated. ### Hardware and settings RTX 5070 Ti 16 GB, Windows 11 26300, `shaders.rpf` of 1.0.2.1. Launched with the fork's `PLAY_FRAMEGEN.cmd` mode 6 (Series X profile, big pools, High priority), with the F1 menu's saved choices on top: 4K output, DLSS Performance, DLSS frame generation 4x. ### Builds (all on fork `main` 9300875 from 2026-11-28) | Build | Contents | Used for | |---|---|---| | **with #638** `103661a` | #339 (`e8e2dfc`), #348 at `5df24f4` plus a local fallback-order fix `cb325c5` (posted in #348), this PR at `b0228f0` | both runs with this PR | | **without #638** `1f10565` | the same, minus this PR, plus a port of Marvisak/VIctory#3619 (atomic-sub loops on NVIDIA; changes one compute program, `weatherParticle:CS_BeginUpdate`) | the baseline | **Confound:** the baseline has the #3619 port and the builds with this PR don't. It changes a single weather-particle program. ### Runs and switches | Run | Log | In the world | Launcher differences | |---|---|---|---| | Baseline | `victory-nvidia-20261128-154834.log` | ~75 min | `VICTORY_SLOT_EVICT=1` at its default 85% | | With #638, first | `...-153204.log` | ~1.7 min | same as baseline | | With #638, second | `...-190912.log` | ~4 min | `VICTORY_SLOT_EVICT_PERCENT=78`; `victory warm` not run for this exe, so pipelines were compiled during play | The baseline and the second #638 run were in different places in the game. ### How the numbers were computed (from the logs, `VICTORY_LOG=warn` plus the default info lines) - **Frame time:** the `victory_gpu::frame_times` lines (one per few seconds). "In the world" means windows whose median is over 20 ms (menus and loading run faster). I report the median and mean of those window medians. These are the game's own frames, before frame generation: 71.4 ms is the pacing on this setup, about 14 game fps (56 shown with 4x frame generation), so the median hides differences and the mean shows them. - **Per list call:** the `list calls translated by threads of ours per frame: N in T ms` lines. Over windows with N > 20,000: sum of T divided by sum of N. T is summed over all threads. ### CPU profile (second run, 60 s while driving) 1. `wpr -start CPU -filemode`, elevated (samply's own recorder needs xperf, which isn't installed), then 60 s later `wpr -stop game.etl`. That gave 3.8 GB. 2. `samply import game.etl --save-only -o prof.json.gz` (samply 0.13.1). 3. A script ([gist](https://gist.github.com/futurepro62/8426c554b68c1bf60fc39f247ca13bc8)) charges every sample of the `victory.exe` process to the nearest `victory.exe` frame on its stack. So time inside ntdll, D3D12 or the driver counts toward the function that called it. It resolves addresses with `dbghelp.dll` against the build's own PDB, and drops samples whose nearest frame is a wait (`Condvar::wait`, park, sleep). Percentages are of the remaining "busy" samples: 693,151 of 2,217,780. Results from that: `list::thin::Recording::run` 34.5% (of it `draw::State::bind` 25.7%), `HostPipeline::new` 14.5% (compiles, because the exe wasn't warmed), `HostHeap::place_back` 0.6% and `HostHeap::cpu` 0.7% self time, and all contended mutexes under 2%. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chemist6913 commented 2026-11-29 04:35:33 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by chemist6913 on 2026-11-29T04:35:33Z.


Merged current main (e1f2eb60) into this branch (41f3187c) and resolved its conflicts. Two of them changed behavior:

  • Dynamic slots. main's dynamic_slots_for is kept as it is. Under the remap, the view limit is SLOT_STRIDES_COUNT - 1, which is past PORTABLE_VIEWS. That would send it down the uncapped branch and hand ~852,000 of the 1,000,000 places to dynamic tables, leaving the pool too small. So under the remap, dynamic_slots returns DYNAMIC, or VICTORY_DYNAMIC_SLOTS clamped to [DYNAMIC, PORTABLE_DYNAMIC_CAP]. Heaps made with an explicit null (main's new tests) are unaffected. Raising VICTORY_DYNAMIC_SLOTS under the remap shrinks the pool by the same amount: 393,216 leaves a pool of 541,246.
  • unmake. main now keeps a neutral view in the slot for 2D textures. That view is written at the slot's place, so the place is given back only when the slot was actually made null.

On the merged tree (RTX 5090):

  • cargo build --locked --release -p victory: clean.
  • cargo test -p victory-gpu: 589 passed.
  • cargo test -p victory-shader: 392 passed, 3 failed. They are the same emit::rect and barycentric hardware tests that fail on unmodified main on this PC.

Thanks to everyone who ran this on other cards. The per-frame give-back and re-take cost reported on the 3080 Ti is a fair point. Keeping the place while a view's record is unchanged is the obvious next step. It is not in this update.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7250745025 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638#issuecomment-7250745025). Originally posted by [chemist6913](https://github.com/chemist6913) on 2026-11-29T04:35:33Z. --- Merged current `main` (`e1f2eb60`) into this branch (`41f3187c`) and resolved its conflicts. Two of them changed behavior: - **Dynamic slots.** `main`'s `dynamic_slots_for` is kept as it is. Under the remap, the view limit is `SLOT_STRIDES_COUNT - 1`, which is past `PORTABLE_VIEWS`. That would send it down the uncapped branch and hand ~852,000 of the 1,000,000 places to dynamic tables, leaving the pool too small. So under the remap, `dynamic_slots` returns `DYNAMIC`, or `VICTORY_DYNAMIC_SLOTS` clamped to `[DYNAMIC, PORTABLE_DYNAMIC_CAP]`. Heaps made with an explicit null (`main`'s new tests) are unaffected. Raising `VICTORY_DYNAMIC_SLOTS` under the remap shrinks the pool by the same amount: 393,216 leaves a pool of 541,246. - **`unmake`.** `main` now keeps a neutral view in the slot for 2D textures. That view is written at the slot's place, so the place is given back only when the slot was actually made null. On the merged tree (RTX 5090): - `cargo build --locked --release -p victory`: clean. - `cargo test -p victory-gpu`: 589 passed. - `cargo test -p victory-shader`: 392 passed, 3 failed. They are the same `emit::rect` and barycentric hardware tests that fail on unmodified `main` on this PC. Thanks to everyone who ran this on other cards. The per-frame give-back and re-take cost reported on the 3080 Ti is a fair point. Keeping the place while a view's record is unchanged is the obvious next step. It is not in this update. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chemist6913 commented 2026-11-29 04:48:34 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by chemist6913 on 2026-11-29T04:48:34Z.


Closing this one. It does what it says: title view slots past 737,855 no longer read the null slot on NVIDIA. But nobody saw a picture difference:

  • in our runs on the 5090;
  • on the 3080 Ti;
  • on the 5070 Ti, where the black props stayed black.

Against that, there is a measured cost. On the 3080 Ti, frames went from 67 to 114 ms, and on the 5070 Ti list translation cost more CPU time per call. It doesn't fix the issues people are hitting either: the phone screen in #545, and the intro crash in #628.

A fix for an invisible bug that costs frame time isn't worth merging. If a scene ever turns up that visibly depends on views past slot 737,855, the branch stays on my fork (fix/nvidia-view-heap-remap, merged with main at 41f3187c). Its starting point should be the 3080 Ti tester's idea: keep a slot's place while the view's record is unchanged, instead of giving it back and taking it again every frame.

Thanks to everyone who tested it on their cards.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7250874406 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638#issuecomment-7250874406). Originally posted by [chemist6913](https://github.com/chemist6913) on 2026-11-29T04:48:34Z. --- Closing this one. It does what it says: title view slots past 737,855 no longer read the null slot on NVIDIA. But nobody saw a picture difference: - in our runs on the 5090; - on the 3080 Ti; - on the 5070 Ti, where the black props stayed black. Against that, there is a measured cost. On the 3080 Ti, frames went from 67 to 114 ms, and on the 5070 Ti list translation cost more CPU time per call. It doesn't fix the issues people are hitting either: the phone screen in #545, and the intro crash in #628. A fix for an invisible bug that costs frame time isn't worth merging. If a scene ever turns up that visibly depends on views past slot 737,855, the branch stays on my fork (`fix/nvidia-view-heap-remap`, merged with `main` at `41f3187c`). Its starting point should be the 3080 Ti tester's idea: keep a slot's place while the view's record is unchanged, instead of giving it back and taking it again every frame. Thanks to everyone who tested it on their cards. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bigboss22869 commented 2026-11-29 09:32:31 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by bigboss22869 on 2026-11-29T09:32:31Z.


A data point after the close, from the RTX 5070 Ti that ran this branch for two days (my comment above).

I measured one build with the places table on and off (VICTORY_VIEW_REMAP=1 / 0): Series X profile, native 1440p, no DLSS, a scripted run at one spot with the camera still, the runs interleaved.

frame, mean of a run frames over 50 ms list translation, all threads the heaps' records
remap on 45.3 and 45.6 ms 36 % 314 ms a frame 20 ms a frame
remap off 40.9 and 41.8 ms 18-23 % 270 ms a frame 7 ms a frame

The draw counts were the same (8,300-8,400 a frame). I saw no picture difference at that spot, with the camera turned all the way round as well, and none in a play session afterwards. So this agrees with the reason for closing: about 4 ms a frame here for nothing visible. The cost is where @futurepro62 guessed: with the remap about 95,000 view slots a frame are left to the draws against 41,000 without it, and 756,000 slots are looked at against 482,000.

Our fork runs with it off by default now (https://github.com/bigboss22869/VIctory-RTX5070Ti, branch rtx5070ti, 63032eff). If a scene turns up that needs views past the cap, I can test the "keep a slot's place while its record is unchanged" idea on this card.

AI-assisted (Claude Code); the runs are mine.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7253831715 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/638#issuecomment-7253831715). Originally posted by [bigboss22869](https://github.com/bigboss22869) on 2026-11-29T09:32:31Z. --- A data point after the close, from the RTX 5070 Ti that ran this branch for two days (my comment above). I measured one build with the places table on and off (`VICTORY_VIEW_REMAP=1` / `0`): Series X profile, native 1440p, no DLSS, a scripted run at one spot with the camera still, the runs interleaved. | | frame, mean of a run | frames over 50 ms | list translation, all threads | the heaps' records | |---|---|---|---|---| | remap on | 45.3 and 45.6 ms | 36 % | 314 ms a frame | 20 ms a frame | | remap off | 40.9 and 41.8 ms | 18-23 % | 270 ms a frame | 7 ms a frame | The draw counts were the same (8,300-8,400 a frame). I saw no picture difference at that spot, with the camera turned all the way round as well, and none in a play session afterwards. So this agrees with the reason for closing: about 4 ms a frame here for nothing visible. The cost is where @futurepro62 guessed: with the remap about 95,000 view slots a frame are left to the draws against 41,000 without it, and 756,000 slots are looked at against 482,000. Our fork runs with it off by default now (https://github.com/bigboss22869/VIctory-RTX5070Ti, branch `rtx5070ti`, `63032eff`). If a scene turns up that needs views past the cap, I can test the "keep a slot's place while its record is unchanged" idea on this card. AI-assisted (Claude Code); the runs are mine.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!638
No description provided.