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

Closed
Kal0s-design wants to merge 661 commits from upstream-pr/440 into main
Kal0s-design commented 2026-11-29 12:04:13 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Kal0s-design on 2026-11-29T12:04:13Z.


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

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5550521424 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/440). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-11-29T12:04:13Z. --- 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)
TaynanGT commented 2026-11-29 13:23:27 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T13:23:27Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7256502210 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/440#issuecomment-7256502210). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T13:23:27Z. --- 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.
safesearch77 commented 2026-11-30 11:15:29 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by safesearch77 on 2026-11-30T11:15:29Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7276771519 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/440#issuecomment-7276771519). Originally posted by [safesearch77](https://github.com/safesearch77) on 2026-11-30T11:15:29Z. --- 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.
TaynanGT commented 2026-11-30 17:06:48 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:06:48Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7285738377 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/440#issuecomment-7285738377). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T17:06:48Z. --- `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 commented 2026-11-30 17:18:41 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:18:41Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7286066514 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/440#issuecomment-7286066514). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T17:18:41Z. --- 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

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
TaynanGT/Vice-Tay!440
No description provided.