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

Open
github-bot wants to merge 1 commit from github-bot/gh-1998 into main AGit
Owner

@⁠ablmontazer2 on GitHub · 2026-11-29 06:28 UTC · original
ablmontazer2:arena-card-budget → main · +37 −3 · 1 files · 1 commits · open

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.

**@⁠ablmontazer2** on GitHub · 2026-11-29 06:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1998) `ablmontazer2:arena-card-budget` → `main` · +37 −3 · 1 files · 1 commits · open **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`.
Entering the world dies with 0x8007000E on 8 GB cards (#1962) because
shadow::by_address arenas have their own card budget (arena_card_most)
of flat 4 GiB, leaving the texture line and filling the card whole.

arena_card_most() now follows the budget the way windows do: on cards
of 12 GiB or less, it is 9 % of the budget, at most 1024 MiB; on bigger
cards it stays 4 GiB. VICTORY_MEMORY_CARD_MB still overrides.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 06:33:51 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-29 06:28 UTC · original · reviewed

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.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-29 06:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1998#pullrequestreview-6101752150) · **reviewed** 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.
Author
Owner

@⁠pickles976 on GitHub · 2026-11-29 08:56 UTC · original · edited 2026-11-29 09:09 UTC

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.

**@⁠pickles976** on GitHub · 2026-11-29 08:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1998#issuecomment-7253432383) · edited 2026-11-29 09:09 UTC 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 can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1998/head:github-bot/gh-1998'
git switch 'github-bot/gh-1998'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1998'
git switch 'github-bot/gh-1998'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1998'
git switch 'github-bot/gh-1998'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1998'
git switch 'main'
git merge --squash 'github-bot/gh-1998'
git switch 'main'
git merge --ff-only 'github-bot/gh-1998'
git switch 'main'
git merge 'github-bot/gh-1998'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!1998
No description provided.