Shadow: the arenas' card room follows the budget on a card of 12 GiB or less (#1962) #1998

Open
ablmontazer2 wants to merge 1 commit from upstream-pr/1998 into main
ablmontazer2 commented 2026-11-29 06:28:50 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ablmontazer2 on 2026-11-29T06:28:50Z.


What happens on an 8 GB card (main 568c5e5)

Entering the world dies with 0x8007000E — a 6 MiB shared buffer no longer fits,
a host command list does not close, a host state prelude does not record — in
four runs of four (#1962), even with the texture bytes capped at 1,956 MB. The
card's non-texture side grows to 3–4.7 GB; the same world on 8fc2254 runs
stable with 8.7 GB of textures streamed.

Why

Since 43a998a the arenas of title memory by address (shadow::by_address) have
their own card budget, arena_card_most(): 4 GiB unless
VICTORY_MEMORY_CARD_MB says otherwise
(bc34ae7 moved them out of the
windows' 1024 MB). Two things make that fatal on a small card:

  • the arenas leave the texture queue's room (43a998a), so the texture line
    fills without seeing their bytes, and they fill without seeing the line's;
  • each arena's own ask only checks card_copy_fits, which stays true until
    the card is nearly whole — one 6 MiB shared buffer then fails and the run
    ends.

A page fault takes by_address(start, PAGE) — one arena at a time, pages
coming in by the thousand at a world entry — so the arenas reach their 4 GiB
well inside the first minutes on any card that lets them. Windows' card sides
are budget-scaled already (default_window_card_mb: 9 % of the budget, at
most 1024 MiB); the arenas were the one card consumer left flat.

The change

arena_card_most() now follows the budget the way the windows do: on a card
of 12 GiB or less it is 9 % of the budget, at most 1024 MiB (624 MiB on the
6.9 GB budget #1962 reports); on a bigger card it stays 4 GiB. An explicit
VICTORY_MEMORY_CARD_MB still wins, and no budget keeps the old default.
Past the most, arenas spill to the PC's memory — the path they all took
before the card took them, so the change cannot strand a program: the side
shaders see moves to memory the CPU holds, as it does today past 4 GiB.

Checks

  • arena_card_default_mb (the pure decision, budget in bytes as
    default_window_card_mb takes it) carries tests beside
    window_room_follows_the_budget: an ask wins, no budget keeps 4096,
    8 GiB gives 737, 12 GiB caps at 1024, 13 GiB and 24 GiB stay 4096.
  • The Windows-side wiring mirrors window_card_most's, which is in main.
  • No game run behind this — the numbers are #1962's. A run on the 5060
    8 GB would confirm: world entry with the patch, or with only
    VICTORY_MEMORY_CARD_MB=700 on today's main (the env var alone should
    already stop the 0x8007000E if this diagnosis holds).

One file: crates/victory-gpu/src/shadow.rs.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5548270205 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1998). Originally posted by [ablmontazer2](https://github.com/ablmontazer2) on 2026-11-29T06:28:50Z. --- **What happens on an 8 GB card (main 568c5e5)** Entering the world dies with 0x8007000E — a 6 MiB shared buffer no longer fits, a host command list does not close, a host state prelude does not record — in four runs of four (#1962), even with the texture bytes capped at 1,956 MB. The card's non-texture side grows to 3–4.7 GB; the same world on 8fc2254 runs stable with 8.7 GB of textures streamed. **Why** Since 43a998a the arenas of title memory by address (`shadow::by_address`) have their own card budget, `arena_card_most()`: **4 GiB unless `VICTORY_MEMORY_CARD_MB` says otherwise** (bc34ae7 moved them out of the windows' 1024 MB). Two things make that fatal on a small card: * the arenas leave the texture queue's room (43a998a), so the texture line fills without seeing their bytes, and they fill without seeing the line's; * each arena's own ask only checks `card_copy_fits`, which stays true until the card is nearly whole — one 6 MiB shared buffer then fails and the run ends. A page fault takes `by_address(start, PAGE)` — one arena at a time, pages coming in by the thousand at a world entry — so the arenas reach their 4 GiB well inside the first minutes on any card that lets them. Windows' card sides are budget-scaled already (`default_window_card_mb`: 9 % of the budget, at most 1024 MiB); the arenas were the one card consumer left flat. **The change** `arena_card_most()` now follows the budget the way the windows do: on a card of 12 GiB or less it is 9 % of the budget, at most 1024 MiB (624 MiB on the 6.9 GB budget #1962 reports); on a bigger card it stays 4 GiB. An explicit `VICTORY_MEMORY_CARD_MB` still wins, and no budget keeps the old default. Past the most, arenas spill to the PC's memory — the path they all took before the card took them, so the change cannot strand a program: the side shaders see moves to memory the CPU holds, as it does today past 4 GiB. **Checks** * `arena_card_default_mb` (the pure decision, budget in bytes as `default_window_card_mb` takes it) carries tests beside `window_room_follows_the_budget`: an ask wins, no budget keeps 4096, 8 GiB gives 737, 12 GiB caps at 1024, 13 GiB and 24 GiB stay 4096. * The Windows-side wiring mirrors `window_card_most`'s, which is in main. * No game run behind this — the numbers are #1962's. A run on the 5060 8 GB would confirm: world entry with the patch, or with only `VICTORY_MEMORY_CARD_MB=700` on today's main (the env var alone should already stop the 0x8007000E if this diagnosis holds). One file: `crates/victory-gpu/src/shadow.rs`.
copilot-pull-request-reviewer[bot] commented 2026-11-29 06:28:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-29T06:28:58Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6101752150 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1998#pullrequestreview-6101752150). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-29T06:28:58Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
pickles976 commented 2026-11-29 08:56:37 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by pickles976 on 2026-11-29T08:56:37Z.


Offscreen compatibility gate on Wine11 / physical RTX4060 Laptop8GiB / NVIDIA590.48.1: I adapted this policy onto our older fork integration, local626099bea7962a020011c647a4d7d16f3fb89045 over6463c325. This is not an exact-head result: our by_address still has the older cumulative admission counter, not your live-arena counters. One existing video-memory query is reused. Explicit overrides and larger/unknown-budget behavior remain intact.

Fresh17.94s intended-GPU build; all seven policy cases pass. Two isolated real-GPU consumers run with MEMORY_CARD_MB=0 and4096, private CPU mirrors enabled, actual NVIDIA/softwareflags0 required. GetHeapProperties must report CUSTOM/WRITE_BACK/L0 for the spill leg and DEFAULT for the control. Each creates a real64KiB by_address shadow, uploads a varied CPU pattern, writes a separate word only on the GPU, then performs an unrelated later CPU write and production refresh/send. Every16384-word readback is checked after each of those three completed phases:98304 correct words across both processes, including preservation of the GPU-only write and untouched data. Two explicit scatter dispatches per leg; no GPU queue deliberately stalled. Aggregate3/3 tests,0ignored,0.91/0.70s runs.

Stock assertion-enabled app-local vkd3d2576c0b4adfae4a DLL hashes and loader paths verified, raw-access chains disabled. GPUpeak345MiB/minavailableRAM12399MiB; external guards unchanged. Initial fixture-only missing MEM_WRITE_WATCH import was corrected to the existing repository constant before these runs. Logs: verify-nvidia-arena-{budget-build-fixed-20261129T084539Z,shared-stock-20261129T084557Z,local-stock-20261129T084600Z}/.

Limits: this checks the actual constructor/refresh/bulk-copy/scatter consumer and native heap types, not original address-translated title shaders, pressured residency, large-arena lifetime/concurrency, your newer live-byte accounting, or a title saving. The previous rendering configuration reached actual cutscenes but stopped on our6000MiB global-GPU guard at6061MiB. That does not by itself attribute the excess to arenas. Shared placement can add host-memory/PCIe pressure on our16GiB/9GiB-scope machine; the modified title result is not yet established. No guard increase, shader skip, or native disk import is introduced.

Follow-up scoping correction: the saved081925 title log consistently reports only5pages,1arena and4copies (3small windows) during the rendered cutscene. In this older tree an arena is64MiB, the directory16MiB and each window page64KiB: roughly80.2MiB of address-arena backing, not a measured multi-GiB arena load. The test policy remains useful compatibility evidence, but the old4GiB allowance was not reached in that observed path. I will not claim this fixes our6061MiB global-GPU cutoff or spend a scene trial on that premise. Short changed startup showed the picker and no kernel fault, but did not invoke the arena policy at all. Next local attribution is native upload-memory placement, not raising limits or enabling Windows residency-priority hints on assumption.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7253432383 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1998#issuecomment-7253432383). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-29T08:56:37Z. --- Offscreen compatibility gate on Wine11 / physical RTX4060 Laptop8GiB / NVIDIA590.48.1: I adapted this policy onto our older fork integration, local626099bea7962a020011c647a4d7d16f3fb89045 over6463c325. This is not an exact-head result: our by_address still has the older cumulative admission counter, not your live-arena counters. One existing video-memory query is reused. Explicit overrides and larger/unknown-budget behavior remain intact. Fresh17.94s intended-GPU build; all seven policy cases pass. Two isolated real-GPU consumers run with MEMORY_CARD_MB=0 and4096, private CPU mirrors enabled, actual NVIDIA/softwareflags0 required. GetHeapProperties must report CUSTOM/WRITE_BACK/L0 for the spill leg and DEFAULT for the control. Each creates a real64KiB by_address shadow, uploads a varied CPU pattern, writes a separate word only on the GPU, then performs an unrelated later CPU write and production refresh/send. Every16384-word readback is checked after each of those three completed phases:98304 correct words across both processes, including preservation of the GPU-only write and untouched data. Two explicit scatter dispatches per leg; no GPU queue deliberately stalled. Aggregate3/3 tests,0ignored,0.91/0.70s runs. Stock assertion-enabled app-local vkd3d2576c0b4adfae4a DLL hashes and loader paths verified, raw-access chains disabled. GPUpeak345MiB/minavailableRAM12399MiB; external guards unchanged. Initial fixture-only missing MEM_WRITE_WATCH import was corrected to the existing repository constant before these runs. Logs: verify-nvidia-arena-{budget-build-fixed-20261129T084539Z,shared-stock-20261129T084557Z,local-stock-20261129T084600Z}/. Limits: this checks the actual constructor/refresh/bulk-copy/scatter consumer and native heap types, not original address-translated title shaders, pressured residency, large-arena lifetime/concurrency, your newer live-byte accounting, or a title saving. The previous rendering configuration reached actual cutscenes but stopped on our6000MiB global-GPU guard at6061MiB. That does not by itself attribute the excess to arenas. Shared placement can add host-memory/PCIe pressure on our16GiB/9GiB-scope machine; the modified title result is not yet established. No guard increase, shader skip, or native disk import is introduced. Follow-up scoping correction: the saved081925 title log consistently reports only5pages,1arena and4copies (3small windows) during the rendered cutscene. In this older tree an arena is64MiB, the directory16MiB and each window page64KiB: roughly80.2MiB of address-arena backing, not a measured multi-GiB arena load. The test policy remains useful compatibility evidence, but the old4GiB allowance was not reached in that observed path. I will not claim this fixes our6061MiB global-GPU cutoff or spend a scene trial on that premise. Short changed startup showed the picker and no kernel fault, but did not invoke the arena policy at all. Next local attribution is native upload-memory placement, not raising limits or enabling Windows residency-priority hints on assumption.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1998:upstream-pr/1998'
git switch 'upstream-pr/1998'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1998'
git switch 'upstream-pr/1998'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1998'
git switch 'upstream-pr/1998'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1998'
git switch 'main'
git merge --squash 'upstream-pr/1998'
git switch 'main'
git merge --ff-only 'upstream-pr/1998'
git switch 'main'
git merge 'upstream-pr/1998'
git push origin 'main'
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!1998
No description provided.