Integrate local fixes and reviewed contributor changes #439

Closed
github-bot wants to merge 734 commits from github-bot/gh-439 into main AGit
Owner

@⁠TaynanGT on GitHub · 2026-11-29 12:02 UTC · original
TaynanGT:review/local-integration-20261129 → main · +65951 −5860 · 226 files · 734 commits · closed without merging

Consolidates the local development branch with 19 contributor PRs, preserving original commits and authorship. This update also includes the latest local strict shader scanning and preload parallelism changes.

Validation of the earlier snapshot: 551 GPU, 227 HLE, 72 loader and 353 shader tests passed; 67 ignored, zero failures. Four launcher configuration cases passed. The subsequent memory changes passed isolated boundary and fragmentation tests; full integrated validation of the latest head is pending.

This remains a draft. Pipeline warming and the 4K boat-route acceptance comparison are not yet complete. No merge or release approval is implied.

**@⁠TaynanGT** on GitHub · 2026-11-29 12:02 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/439) `TaynanGT:review/local-integration-20261129` → `main` · +65951 −5860 · 226 files · 734 commits · closed without merging Consolidates the local development branch with 19 contributor PRs, preserving original commits and authorship. This update also includes the latest local strict shader scanning and preload parallelism changes. Validation of the earlier snapshot: 551 GPU, 227 HLE, 72 loader and 353 shader tests passed; 67 ignored, zero failures. Four launcher configuration cases passed. The subsequent memory changes passed isolated boundary and fragmentation tests; full integrated validation of the latest head is pending. This remains a draft. Pipeline warming and the 4K boat-route acceptance comparison are not yet complete. No merge or release approval is implied.
docs/this-fork.md said a queue submits itself at half its capacity.
Since 68e10e57 it starts its requests at the title's own submit, and
submits itself only when it is full of commands nobody submitted;
VICTORY_DSTORAGE_HALF=1 brings the half-capacity submit back
(crates/victory-hle/src/modules/dstorage.rs, half_submits and queue).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Adapt the texture view fix from Marvisak/VIctory#331 (ccdecb80807826e49ce82a5d9aa6e7814d2b8376). On devices that support fully typed format casting, preserve the requested transfer function for RGBA, BGRA, BGRX and BC1/2/3/7 shader resource views. Keep the existing UAV rules and bypass format matching on identical formats.

Exercise both directions and the default view using a compute shader that reads the texture through the runtime. Compare the pixel values returned by all seven format pairs.
Use the view and sampler handles directly from a two-slot array. Keep the existing binding order and command-list lifetime for each available heap, including when only a sampler is bound.

The fixed-size binding idea comes from Xavi Fortes in XaviFortes/VIctory-RDNA@c43982ea2c.
Without VICTORY_BCPACK_TABLES the title still runs, but its BCPack
textures show as square block noise, and one early log line was the only
sign. play.ps1 now warns when the variable is unset or not a file, the
runtime warning says what the failure looks like, and the README says
what happens without the tables.

Fixes #385.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
drop_views unmapped the two_views views without title_memory_unmapping, so their VIEWS bits stayed set; a later test whose allocation landed there had it left out of the asking (a_raw_copy_in_watched_memory_keeps_the_other_asked_ranges: 5 of 30 full runs failed on main, 0 of 40 with this).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The automatic NVIDIA profile for 10 to 14 GB cards now sets
VICTORY_TITLE_PREWARM_COUNT=3328 (#178): the first 3D frames ask for
thousands of 64 KiB title buffers, made during the menu instead. On an
RTX 3080 10 GB, eight alternating runs had fewer hitches entering the
world; the measurements are in docs/rtx5080-16gb.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With VICTORY_THIN=1 the black patches and stretched triangles of #90 showed in
about 200 of 967 frames of a recorded 240 s walk on an RTX 5070 Ti 16 GB with a
Ryzen 7 9850X3D; with it off, in 3 of about 960, at about the same frame rate
(median 18.7 against 20.2 while recording, 19.0 against 18.2 without).

Only an explicit -Machine 4070tisuper with -Console series-s, and not under
-Safe, which never set it. -More @{VICTORY_THIN='1'} turns it back on.
-Machine auto and Series X are unchanged.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
nvidia_paired_fp32_ordered_sum and nvidia_paired_fp32_min_max only run
the paired form when VICTORY_WAVE_PAIRS=1 is set as well. Their ignore
reasons named only VICTORY_WAVE_PAIRS_FP32, so a run that followed them
failed with paired=false. Name both variables and assert the pairing
switch first, as the other paired tests in this file do.

Fixes #373.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013YhYveEj8Y5ZZys8eqzHAx
Keep handing out sequential page numbers while they fit the title's
21-bit number >> 4 representation, then reuse the lowest contiguous
free run and fail cleanly with count=0 if exhausted. The O(P log P)
key sort only fires past ~124 GiB of cumulative allocations.

Ported from trustno1-coder/VIctory-NVIDIA 108a897 (illuminatedfellow,
from avatarmanz/VIctory-7900XTX#316).
VICTORY_VRAM_HEADROOM_MB (off by default, at most 8,192) takes that many
MB off the card's budget in Host::video_memory, so every rule that asks
how much room the card has (the 80 to 97 % shares and the eviction of
vram_keep) works from what is left.

Under Proton the budget is about this process's use plus all of the
card's free memory, and nothing moves this process's memory aside for
the desktop compositor as WDDM does. On an 8 GB RTX 4070 Laptop the title
used 5,823 MB of a 5,823 MB budget and the compositor could not allocate
its next buffer. The variable leaves that room free; 1024 is a starting
value there. The log's video memory line names the headroom when it is
set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
targets_room_kept() defaulted to reserving 3,072 MiB regardless of card
size. On an 8 GB / Series S card (5,889 MiB DXGI budget, or 4,865 MiB
with headroom), render targets settle around 1,300 MiB, leaving
~1.7-1.8 GB counted as permanently in use in both resource::room() and
let_go_idle().

Cap the unconfigured default at min(3,072 MiB, 30% of the card budget).
Budgets of at least 10 GiB (10,240 MiB) still keep the full 3,072 MiB
reserve, and explicit VICTORY_CARD_ROOM_FOR_TARGETS_MB overrides keep
their prior behavior.
With a cold pipeline cache, three workers kept the world black for about
six minutes on the i5-12400F; six workers cut that to under five and
emptied the queue three minutes sooner, with no fewer frames afterwards.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A draw waiting for a quick pipeline no longer waits behind compiles of a
minute. With a cold driver cache on an RTX 3060 the scene was drawn about
four minutes sooner and in full no later. VICTORY_PIPELINE_SLOW_ASKED=0
keeps the previous order.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The table code_dword reads was the program's code from the lowest offset
any load or descriptor names, and a load at a computed offset names
offset 0: the table was the whole program. Under vkd3d-proton that
constant array becomes a private one, which NVIDIA keeps in every
thread's local memory. For smh_gen_130 CS_InterpolateStrands
(f7c4f227a2a4c4b2) that is 4,352 dwords per thread, and the GPU then
writes outside its memory: an MMU fault (Xid 13) at the start of the
intro, or command-stream errors (Xid 32/11/69/109) whose method data are
dwords of this shader's code.

The program's constants follow its instructions, and a load at a
computed offset reads them, so the table now starts where the
instructions end, unless a load at a fixed offset reads below that. For
this shader it is 175 dwords from 0x4144. TRANSLATOR_VERSION goes to 16
so cached translations are made again.

Ported from Marvisak/VIctory e04c078 (#2143).

Co-authored-by: desp <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013YhYvcLBjaGbDCQ5ckiBtQ
`emit()` confirmed the guest float mode for the programs paired by default
only while `VICTORY_WAVE_PAIRS_ONLY` was unset. A list that names default
programs (the #378 workaround is the default list minus one) took that away,
and 7 of 28 listed programs were refused the paired form and fell back to the
unpaired one, which brought back the dark blocks on open water (#426).

The confirmation now depends only on the default list. Their MODE writes were
checked either way, and `VICTORY_WAVE_PAIRS_FP32` still overrides it.

Translations cached under a list before this refused those programs the
paired form, so the cache key gets a marker while the list is set. Runs
without the variable keep their key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The marker ended in a raw NUL byte instead of `\0`, which the asset policy
rejects as binary content.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`warm` printed the VICTORY_PIPELINE_BOOK=1 hint only when the pipelines
folder was missing. Runs keep the host pipeline library in that folder
without the book, so after a normal run `warm --used` reported
"0 pipelines known ... 0 to make" with no hint (#433). Print the hint when
nothing is recorded, and let play.ps1 -WarmPipelines turn the book on for
its run so the next warm has something to make.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Based on 88f7d6dc (TaynanGT), 3ffa31f5, b45345c1 and fb40506b (Urielbeaupre). Preserve shader preparation in the launcher. GPU tests: 599 passed, 45 ignored; in-game performance acceptance not met.
Adapt 0334d598 (El_Santo). GPU tests: 601 passed, 45 ignored. In-game gain not established.
Adapt aec5c860 (mikey), feb90ade (Shawn), 0dd34bdb (uiliaannn), d07db0fd (Damokles2). Translator cache version 16. Tests: 1004 passed, no failures.
Adapt cd935520 (fxceless) and b04964cd (Aws Ali). Translator cache version 17. GPU and water tests: 604 passed, 45 ignored. Boat benchmark did not demonstrate a performance improvement.
Adapt the memory accounting issue addressed by a38716d97 (Mateo). GPU tests: 603 passed, 45 ignored; cargo check passed.
Invalidate obsolete scan markers and verify stable inputs before recording completion. App tests: 42 passed.
Include shader name parsing, zero-duration waits and indirect diagnostics. GPU and game tests: 609 passed, 45 ignored.
Correct early texture preparation, worker limits, rectangle buffers and 1% low reporting. GPU tests: 607 passed, 45 ignored.
Validate conflicting upscaler settings and local media and name resolution. Correct regression test pointer types. Tests: 948 passed, 48 ignored, 225 filtered in one invocation. No new gameplay acceptance test.
Serialize scalar values and handles explicitly and initialize GameLicense padding. HLE tests passed. No gameplay validation.
Add the signed NaN regression case and restrict the pool block counter to its diagnostic and test users. Both shader regressions and normal-profile cargo check passed.
Use the exact validated container hashes to permit wave-wide lowering without enabling it globally. Adapt the scoped volumetric approach from readmet3xt-lab (cf87a47c). Invalidate old precompile markers, keep unrelated translation cache keys unchanged. Both shaders passed DXIL validation and D3D12 pipeline creation on RTX 4090. Gameplay and geometry shader support remain unverified.
Adapt native geometry support from bar (535de92e, nativ69/shader/support-native-geometry-shaders), preserving existing paired-wave lowering, early depth, validator checks and pipeline cache tracing. All 195 previously refused geometry shaders passed DXIL validation and standalone D3D12 pipeline creation on RTX 4090; the two water shaders also passed in this build. Gameplay acceptance and full archive rescan remain pending.
Consolidate the local diagnostics work with the integrated renderer. Preserve the required 4K gameplay, preloading and local-only review policy. Frame measurement script and GPU suite passed.
Integrate 78e424c4, fa92ed75 and e396ba09, adapting the merged fixtures and bumping the translation cache to version 18. Credit pr0vId3nce (Belobug/VIctory-Belobug-AMD#578) and tippythetaidum (fxceless/victory-fork#927). GPU tests and targeted half tests passed; all 197 recovered shaders validated and created pipelines on RTX 4090. Full archive scan and gameplay acceptance remain separate gates.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Prevent a concurrent writer from completing before the first update has been queued. Add a publication-boundary regression test. GPU card tests: 39 passed, 2 ignored; targeted regression: 1 passed.
Preserve byte totals while recording elapsed preparation time per category. Avoid wrapping counters when the meter drains them concurrently. Three regression tests passed; mixed-batch measurement overhead still requires runtime profiling.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 12:04:53 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 12:30 UTC · original

Ran the shader preload of this branch (cfd5ebd, release build) on Windows against a 1.0.2.1 dump, with an empty cache each time:

  • Whole game folder: 25,985 shaders, 0 fail, 0 corrupt, scan complete, 495 s. The second --if-needed run printed "already pretranslated" in 2 s, so the stricter marker works here. The 197 that main can't translate now go through.
  • With the 2 GiB skip gone, the big archives (levels.rpf 76 GB, audio.rpf 28 GB, ...) are mapped and read whole. None of them gives a shader: shaders.rpf plus the .exe and .dll files at the top of the folder (18 files) give the same 25,985 in 121 s. While the whole-folder scan ran, the process working set was about 45 GB of mapped archive pages (about 0.3 GB private). Windows can drop those, but on a 16 GB machine that's all of RAM, and on a hard disk it's the #421 wait made several times longer.

#440 makes play.ps1 pass only those files when shaders.rpf is there. The new -RequirePreload / -PreloadOnly path here passes the whole folder too and could use the same list.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-11-29 12:30 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/439#issuecomment-7255864822) Ran the shader preload of this branch (cfd5ebd, release build) on Windows against a 1.0.2.1 dump, with an empty cache each time: - Whole game folder: 25,985 shaders, 0 fail, 0 corrupt, scan complete, **495 s**. The second `--if-needed` run printed "already pretranslated" in 2 s, so the stricter marker works here. The 197 that main can't translate now go through. - With the 2 GiB skip gone, the big archives (`levels.rpf` 76 GB, `audio.rpf` 28 GB, ...) are mapped and read whole. None of them gives a shader: `shaders.rpf` plus the `.exe` and `.dll` files at the top of the folder (18 files) give the same 25,985 in **121 s**. While the whole-folder scan ran, the process working set was about 45 GB of mapped archive pages (about 0.3 GB private). Windows can drop those, but on a 16 GB machine that's all of RAM, and on a hard disk it's the #421 wait made several times longer. #440 makes `play.ps1` pass only those files when `shaders.rpf` is there. The new `-RequirePreload` / `-PreloadOnly` path here passes the whole folder too and could use the same list. AI-assisted: yes
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 12:48 UTC · original

The red Clippy job here comes from two real lints plus the undocumented_unsafe_blocks change. warn in Cargo.toml becomes an error under CI's -D warnings: 89 blocks without features, 131 with --all-features. #442 (against this branch) fixes the two real ones. Without the safety lint, clippy is then clean for both feature sets. Details and per-file counts are in #442.

**@⁠Kal0s-design** on GitHub · 2026-11-29 12:48 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/439#issuecomment-7256072528) The red Clippy job here comes from two real lints plus the `undocumented_unsafe_blocks` change. `warn` in `Cargo.toml` becomes an error under CI's `-D warnings`: 89 blocks without features, 131 with `--all-features`. #442 (against this branch) fixes the two real ones. Without the safety lint, clippy is then clean for both feature sets. Details and per-file counts are in #442.
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 13:11 UTC · original

#442 now covers the whole Clippy job: the two real lints plus a SAFETY comment on every block the new warn flags. Clippy is clean with and without --all-features, the diag check is clean, and the lib tests pass. The commit text in #442 says which comments are moved or repeated from the original author and which reasons are new.

**@⁠Kal0s-design** on GitHub · 2026-11-29 13:11 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/439#issuecomment-7256360736) #442 now covers the whole Clippy job: the two real lints plus a SAFETY comment on every block the new `warn` flags. Clippy is clean with and without `--all-features`, the diag check is clean, and the lib tests pass. The commit text in #442 says which comments are moved or repeated from the original author and which reasons are new.
Author
Owner

@⁠safesearch77 on GitHub · 2026-11-29 13:20 UTC · original

Heads-up on two PRs already merged here: each now has a one-commit follow-up on its branch that you may want in this integration.

  • #409 (XMem page-number recycling), c16c806391: a correctness fix. Once the 21-bit space is used up, a lowest-fit run can reach into the numbers at and above next_page that were never given out, without moving next_page. The next allocation that still fits there then gets those live numbers again, and XMemAllocatePhysicalPages replaces their Slices. The fix is 2 lines in Pages::take (self.next_page = self.next_page.max(first + len)), plus explicit tests for live mappings, the PAGE_LIMIT refusal, and fragmented free runs. It applies cleanly on cfd5ebd. There, the new regression test fails without the fix and passes with it (Wine, victory-hle --lib -- modules::xmem 23/23). It's only reachable after about 124 GiB of total physical allocations; a test found it, and no run has hit it. Details: #409
  • #414 (VRAM headroom), 937b8b668f: keeps a 1-byte floor when the headroom eats the whole budget, so the budget == 0 "no budget reported" fallback (5 s eviction) doesn't kick in. It cherry-picks cleanly onto cfd5ebd. Details: #414

AI-assisted: yes (Claude), reviewed locally before posting.

**@⁠safesearch77** on GitHub · 2026-11-29 13:20 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/439#issuecomment-7256464084) Heads-up on two PRs already merged here: each now has a one-commit follow-up on its branch that you may want in this integration. - **#409 (XMem page-number recycling), c16c8063912d82ec8fb8a9923816c818ac54c9bf:** a correctness fix. Once the 21-bit space is used up, a lowest-fit run can reach into the numbers at and above `next_page` that were never given out, without moving `next_page`. The next allocation that still fits there then gets those live numbers again, and `XMemAllocatePhysicalPages` replaces their `Slice`s. The fix is 2 lines in `Pages::take` (`self.next_page = self.next_page.max(first + len)`), plus explicit tests for live mappings, the `PAGE_LIMIT` refusal, and fragmented free runs. It applies cleanly on cfd5ebd. There, the new regression test fails without the fix and passes with it (Wine, `victory-hle --lib -- modules::xmem` 23/23). It's only reachable after about 124 GiB of total physical allocations; a test found it, and no run has hit it. Details: https://git.gtahub.st/github/TaynanGT--Vice-Tay/pulls/409 - **#414 (VRAM headroom), 937b8b668f2889ada164f7e3a47ed5e6dbdcef73:** keeps a 1-byte floor when the headroom eats the whole budget, so the `budget == 0` "no budget reported" fallback (5 s eviction) doesn't kick in. It cherry-picks cleanly onto cfd5ebd. Details: https://git.gtahub.st/github/TaynanGT--Vice-Tay/pulls/414 AI-assisted: yes (Claude), reviewed locally before posting.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 13:23 UTC · original

Thanks for the detailed follow-ups. I have integrated the Clippy fixes locally, the XMem page-number recycling correction from #409, and the positive VRAM budget floor from #414. I also adapted #440 for the optional preload path, keeping the full scan for mandatory validation until I can verify equivalent coverage locally. The current integration still needs the complete test suite and a 4K boat-route run before publication.

**@⁠TaynanGT** on GitHub · 2026-11-29 13:23 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/439#issuecomment-7256501674) Thanks for the detailed follow-ups. I have integrated the Clippy fixes locally, the XMem page-number recycling correction from #409, and the positive VRAM budget floor from #414. I also adapted #440 for the optional preload path, keeping the full scan for mandatory validation until I can verify equivalent coverage locally. The current integration still needs the complete test suite and a 4K boat-route run before publication.
github-bot closed this pull request 2026-11-30 17:08:38 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-30 17:06 UTC · original

Superseded: main has moved to a new line of the code (see #468). Whatever is still worth having from this will come back as a new PR on the current main.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:06 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/439#issuecomment-7285741393) Superseded: `main` has moved to a new line of the code (see #468). Whatever is still worth having from this will come back as a new PR on the current `main`.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.