Pretranslate from shaders.rpf, the executable and its DLLs #440

Closed
github-bot wants to merge 661 commits from github-bot/gh-440 into main AGit
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 12:04 UTC · original
Kal0s-design:fix/shader-scan-top-level → main · +60022 −5429 · 206 files · 661 commits · closed without merging

Refs #421 (point 4, the shader scan).

play.ps1 passes the whole game folder to victory shaders --if-needed. On main that reads every file under 2 GiB, which on the 1.0.2.1 dump is 93 files and about 44 GB. #421 measured over 40 minutes on a hard disk. #439 removes the 2 GiB skip, so the same call would read all 209 GB.

Where the shaders are, same dump, empty cache each time:

Scan input main (fe7c6e5) #439 (cfd5ebd)
whole game folder 25,788 (197 do not translate) 25,985 (0 fail), 495 s
every file at the top of the folder (42) 25,788 25,985, 371 s
shaders.rpf + .exe + .dll at the top (18 files) 25,788 25,985, 121 s
shaders.rpf alone 25,692 –

Scanning each file on its own puts the shaders outside shaders.rpf in XboxBvhBuilder.dll (52), amd_fidelityfx_upscaler_xbox.dll (29) and game_scarlett_master.exe (15). Nothing in data\, pack\ or the other big archives gives one. With #439 the big archives are mapped whole, and the full-folder scan held about 45 GB of the file in the process working set while it ran (page cache, about 0.3 GB private).

Change:

  • When the source folder has shaders.rpf, play.ps1 passes shaders.rpf and the .exe and .dll files beside it. Otherwise it passes the folder as before.
  • One README sentence saying so.

Checked by running the new launcher lines on their own, without the title, with both builds: 25,788 on main and 25,985 with #439, the same as their whole-folder scans. The second run prints "Shader cache already pretranslated" in 1 to 2 s. Existing caches get one rescan, since the source paths are part of the stamp, but every translation is already cached. cargo xtask policy is clean.

#439's new -RequirePreload / -PreloadOnly path also passes the whole folder and could use the same list.

AI-assisted: yes

🤖 Generated with Claude Code

**@⁠Kal0s-design** on GitHub · 2026-11-29 12:04 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/440) `Kal0s-design:fix/shader-scan-top-level` → `main` · +60022 −5429 · 206 files · 661 commits · closed without merging Refs #421 (point 4, the shader scan). `play.ps1` passes the whole game folder to `victory shaders --if-needed`. On main that reads every file under 2 GiB, which on the 1.0.2.1 dump is 93 files and about 44 GB. #421 measured over 40 minutes on a hard disk. #439 removes the 2 GiB skip, so the same call would read all 209 GB. Where the shaders are, same dump, empty cache each time: | Scan input | main (fe7c6e5) | #439 (cfd5ebd) | |---|---|---| | whole game folder | 25,788 (197 do not translate) | 25,985 (0 fail), **495 s** | | every file at the top of the folder (42) | 25,788 | 25,985, 371 s | | `shaders.rpf` + `.exe` + `.dll` at the top (18 files) | **25,788** | **25,985, 121 s** | | `shaders.rpf` alone | 25,692 | – | Scanning each file on its own puts the shaders outside `shaders.rpf` in `XboxBvhBuilder.dll` (52), `amd_fidelityfx_upscaler_xbox.dll` (29) and `game_scarlett_master.exe` (15). Nothing in `data\`, `pack\` or the other big archives gives one. With #439 the big archives are mapped whole, and the full-folder scan held about 45 GB of the file in the process working set while it ran (page cache, about 0.3 GB private). Change: - When the source folder has `shaders.rpf`, `play.ps1` passes `shaders.rpf` and the `.exe` and `.dll` files beside it. Otherwise it passes the folder as before. - One README sentence saying so. Checked by running the new launcher lines on their own, without the title, with both builds: 25,788 on main and 25,985 with #439, the same as their whole-folder scans. The second run prints "Shader cache already pretranslated" in 1 to 2 s. Existing caches get one rescan, since the source paths are part of the stamp, but every translation is already cached. `cargo xtask policy` is clean. #439's new `-RequirePreload` / `-PreloadOnly` path also passes the whole folder and could use the same list. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The launcher passed the whole game folder to `victory shaders`, which
reads every file below the 2 GiB limit: on the 1.0.2.1 dump that is 93
files and about 44 GB, mostly in data\ and pack\. A hard disk spent over
40 minutes there (#421). All 25,788 shaders the full walk finds are in
the files at the top of the folder: 25,692 in shaders.rpf, 52 in
XboxBvhBuilder.dll, 29 in the FidelityFX upscaler DLL and 15 in the
executable. Pass those files (1.57 GB) instead; a folder without files
still gets the whole walk.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 12:04:54 +00:00
github-bot changed title from Pretranslate from the files at the top of the game folder to Pretranslate from shaders.rpf, the executable and its DLLs 2026-11-29 12:31:18 +00:00
The top-level files still include anim.rpf, data.rpf, gameos.xvd and the
other archives, and #439 removes the 2 GiB skip, so they would add
levels.rpf (76 GB) and audio.rpf (28 GB) back. On 1.0.2.1 shaders.rpf,
the executable and the DLLs (18 files) hold every shader the whole
folder does: 25,788 on main, 25,985 with #439's translator, in about
2 minutes against 8 for the whole folder with #439. Without shaders.rpf
the folder is walked as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

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

Thanks for measuring the scan scope. I have adapted the shader-bearing file selection for the optional launch path. I am keeping the mandatory preload path on the full scan until the same shader set is verified locally; the reported 1.0.2.1 results are promising.

**@⁠TaynanGT** on GitHub · 2026-11-29 13:23 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/440#issuecomment-7256502210) Thanks for measuring the scan scope. I have adapted the shader-bearing file selection for the optional launch path. I am keeping the mandatory preload path on the full scan until the same shader set is verified locally; the reported 1.0.2.1 results are promising.
Author
Owner

@⁠safesearch77 on GitHub · 2026-11-30 11:15 UTC · original

One data point from Linux / Proton for this PR. On Linux, the whole-folder scan under #439 does not just take a long time: it never finishes, so linux/play.sh would rescan on every launch.

Setup: #439 at cfd5ebd (diagnostics build), victory shaders Z:\game on the 1.0.2.1 dump, GE-Proton11-14, CachyOS, RTX 4070 Laptop 8 GB, NVMe.

  • Translation itself is clean: 25,985 shaders in the cache, 0 that do not translate, 0 that could not be cached (221 s with an empty cache, 70 s on a rerun).
  • 108 of the 109 files were read, including the 15 other archives over 2 GiB (up to audio.rpf at 26.6 GiB). With VICTORY_LOG=info,victory::shader::scan=debug, the one that fails is levels.rpf (70.9 GiB):
    DEBUG victory::shader::scan: mapping \\?\Z:\game\levels.rpf: Not enough memory. (os error 8)
    file scan incomplete (I/O errors): files read 108, skipped 1 (walk errors 0, metadata errors 0, read errors 1, over 2147483648 bytes: 0)
    Error: shader scan incomplete: input I/O errors; retry before launch
    
    It failed the same way in both runs. Nothing in this sandbox limits address space (ulimit -v is unlimited, overcommit_memory=0). Your Windows table shows the whole-folder scan getting through with #439, so this looks like Wine's MapViewOfFile refusing a single view of that size, not something the scanner does wrong.
  • Because of check_precompile_scan, no completion marker is written, so run shaders --if-needed in linux/play.sh repeats the whole pass at every launch and then continues. #430's top-level list still includes levels.rpf, so it would hit the same failure.

The file list in this PR (shaders.rpf plus the .exe and .dll files beside it) never opens levels.rpf, so the same list in linux/play.sh should fix the problem on Linux too. Separately, a fallback in MappedFile::open (smaller views, or a streamed read when the whole-file view is refused) would keep a full-folder scan working under Wine. I haven't tested either change yet. I'm happy to test whichever one lands, or to send the play.sh side once it's clear how it should fit with #430.

**@⁠safesearch77** on GitHub · 2026-11-30 11:15 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/440#issuecomment-7276771519) One data point from Linux / Proton for this PR. On Linux, the whole-folder scan under #439 does not just take a long time: it never finishes, so `linux/play.sh` would rescan on every launch. Setup: #439 at `cfd5ebd` (diagnostics build), `victory shaders Z:\game` on the 1.0.2.1 dump, GE-Proton11-14, CachyOS, RTX 4070 Laptop 8 GB, NVMe. - Translation itself is clean: 25,985 shaders in the cache, 0 that do not translate, 0 that could not be cached (221 s with an empty cache, 70 s on a rerun). - 108 of the 109 files were read, including the 15 other archives over 2 GiB (up to `audio.rpf` at 26.6 GiB). With `VICTORY_LOG=info,victory::shader::scan=debug`, the one that fails is `levels.rpf` (70.9 GiB): ``` DEBUG victory::shader::scan: mapping \\?\Z:\game\levels.rpf: Not enough memory. (os error 8) file scan incomplete (I/O errors): files read 108, skipped 1 (walk errors 0, metadata errors 0, read errors 1, over 2147483648 bytes: 0) Error: shader scan incomplete: input I/O errors; retry before launch ``` It failed the same way in both runs. Nothing in this sandbox limits address space (`ulimit -v` is unlimited, `overcommit_memory=0`). Your Windows table shows the whole-folder scan getting through with #439, so this looks like Wine's `MapViewOfFile` refusing a single view of that size, not something the scanner does wrong. - Because of `check_precompile_scan`, no completion marker is written, so `run shaders --if-needed` in `linux/play.sh` repeats the whole pass at every launch and then continues. #430's top-level list still includes `levels.rpf`, so it would hit the same failure. The file list in this PR (`shaders.rpf` plus the `.exe` and `.dll` files beside it) never opens `levels.rpf`, so the same list in `linux/play.sh` should fix the problem on Linux too. Separately, a fallback in `MappedFile::open` (smaller views, or a streamed read when the whole-file view is refused) would keep a full-folder scan working under Wine. I haven't tested either change yet. I'm happy to test whichever one lands, or to send the `play.sh` side once it's clear how it should fit with #430.
github-bot closed this pull request 2026-11-30 17:08:37 +00:00
Author
Owner

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

main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:06 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/440#issuecomment-7285738377) `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.
Author
Owner

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

Thanks for trying this under Proton and posting the log. The levels.rpf failure is the useful bit: 70.9 GiB is too big for a single MapViewOfFile view under Wine, and the shaders.rpf + exe/dll list never touches it. A fallback in MappedFile::open for refused views sounds worth trying too. If either holds up on the new main (#468), send it as a PR and I'll review.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:18 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/440#issuecomment-7286066514) Thanks for trying this under Proton and posting the log. The `levels.rpf` failure is the useful bit: 70.9 GiB is too big for a single `MapViewOfFile` view under Wine, and the `shaders.rpf` + exe/dll list never touches it. A fallback in `MappedFile::open` for refused views sounds worth trying too. If either holds up on the new `main` (#468), send it as a PR and I'll review.

Pull request closed

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