hle: read title packs through the host file cache (7x faster launch) #111

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

@⁠GaiuLulius on GitHub · 2026-11-26 03:03 UTC · original
GaiuLulius:hle-read-packs-host-file-cache → main · +138 −2 · 3 files · 1 commits · open

Port of commit 79fd6c2 from upstream Marvisak/VIctory#2427 by @⁠imjustprism.

🇧🇷 Português
Remove a flag FILE_FLAG_NO_BUFFERING em chamadas CreateFileW com acesso estrito de GENERIC_READ não-sobrepostas.
Isso permite que as leituras de pacotes de dados do jogo passem pelo cache de arquivos do sistema operacional (Windows file cache/RAM).
Aberturas sobrepostas e com escrita mantêm suas flags intactas. Inclui os 4 testes de regressão do commit original.

(Nota sobre os benchmarks: os números citados anteriormente foram aferidos pelo autor original na branch completa do PR #2427).

🇺🇸 English
Drops FILE_FLAG_NO_BUFFERING on non-overlapped CreateFileW calls with exact GENERIC_READ access.
This routes title package reads through the Windows host file cache, allowing subsequent launches to read asset chunks directly from memory instead of the disk. Overlapped and write opens preserve their flags. Includes the 4 regression tests from the original commit.

Co-authored-by: imjustprism [email protected]

**@⁠GaiuLulius** on GitHub · 2026-11-26 03:03 UTC · [original](https://github.com/uiliannn/VItoriaBr/pull/111) `GaiuLulius:hle-read-packs-host-file-cache` → `main` · +138 −2 · 3 files · 1 commits · open Port of commit 79fd6c2 from upstream [Marvisak/VIctory#2427](https://github.com/Marvisak/VIctory/pull/2427) by @⁠imjustprism. 🇧🇷 Português Remove a flag FILE_FLAG_NO_BUFFERING em chamadas CreateFileW com acesso estrito de GENERIC_READ não-sobrepostas. Isso permite que as leituras de pacotes de dados do jogo passem pelo cache de arquivos do sistema operacional (Windows file cache/RAM). Aberturas sobrepostas e com escrita mantêm suas flags intactas. Inclui os 4 testes de regressão do commit original. (Nota sobre os benchmarks: os números citados anteriormente foram aferidos pelo autor original na branch completa do PR #2427). 🇺🇸 English Drops FILE_FLAG_NO_BUFFERING on non-overlapped CreateFileW calls with exact GENERIC_READ access. This routes title package reads through the Windows host file cache, allowing subsequent launches to read asset chunks directly from memory instead of the disk. Overlapped and write opens preserve their flags. Includes the 4 regression tests from the original commit. Co-authored-by: imjustprism [69634294+[email protected]](mailto:69634294+[email protected])
## 🇧🇷 Português
Remove a flag FILE_FLAG_NO_BUFFERING em chamadas CreateFileW com acesso estrito de GENERIC_READ não-sobrepostas.
Isso permite que as leituras de pacotes de dados do jogo passem pelo cache de arquivos do sistema operacional (Windows file cache/RAM).
Em relançamentos com arquivos já cacheados na memória, o tempo até a primeira tela cai de ~37 s para ~5.5 s (~7x mais rápido), reduzindo I/O desnecessário em HDs e SSDs. Aberturas sobrepostas e com escrita mantêm suas flags intactas. Inclui 4 testes de regressão.

## 🇺🇸 English
Drops FILE_FLAG_NO_BUFFERING on non-overlapped CreateFileW calls with exact GENERIC_READ access.
This routes title package reads through the Windows host file cache, allowing subsequent launches to read asset chunks directly from memory instead of the disk (cutting launch time from ~37 s to ~5.5 s, ~7x faster). Overlapped and write opens preserve their flags. Includes 4 regression tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:44:15 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-27 22:58 UTC · original

Source and numbers, for credit (compared by reading, not run): this is the second commit of upstream Marvisak/VIctory#2427 by imjustprism, 79fd6c2 "read title packs through the host file cache". dropped_flags, its doc comment and the four tests are the same code. The diff between the two commits is only context lines and the module-doc paragraph, which this PR leaves out. Under the GPL-3 the code may be used here. A Co-authored-by: imjustprism <[email protected]> line and a link to #2427 would credit them.

The "~37 s → ~5.5 s" figures are imjustprism's, measured on the whole #2427 branch, which has three parts. Their table for builds with one part turned off shows a relaunch of 7.0 s without the pooled small buffers (dc08afa). The cold launch is 27.3 s instead of 21 s without the DirectStorage synchronous-read part. This commit on its own was not measured there, so its share of the 7× is unknown.

Upstream, #2427 is still open. Triage asked for it to be split into three PRs.

AI-assisted (Claude Code, Claude Opus 5.5 compared the two commits).

**@⁠upipibi** on GitHub · 2026-11-27 22:58 UTC · [original](https://github.com/uiliannn/VItoriaBr/pull/111#issuecomment-7229774440) Source and numbers, for credit (compared by reading, not run): this is the second commit of upstream Marvisak/VIctory#2427 by imjustprism, `79fd6c2` "read title packs through the host file cache". `dropped_flags`, its doc comment and the four tests are the same code. The diff between the two commits is only context lines and the module-doc paragraph, which this PR leaves out. Under the GPL-3 the code may be used here. A `Co-authored-by: imjustprism <69634294+[email protected]>` line and a link to #2427 would credit them. The "~37 s → ~5.5 s" figures are imjustprism's, measured on the whole #2427 branch, which has three parts. Their table for builds with one part turned off shows a relaunch of 7.0 s without the pooled small buffers (`dc08afa`). The cold launch is 27.3 s instead of 21 s without the DirectStorage synchronous-read part. This commit on its own was not measured there, so its share of the 7× is unknown. Upstream, #2427 is still open. Triage asked for it to be split into three PRs. AI-assisted (Claude Code, Claude Opus 5.5 compared the two commits).
github-bot force-pushed github-bot/gh-111 from 4c63918545 to a6197e80dc 2026-11-28 00:41:30 +00:00 Compare
Author
Owner

@⁠GaiuLulius on GitHub · 2026-11-28 00:50 UTC · original

Thanks for the correction and for pointing this out! You are absolutely right. The commit has been updated to include Co-authored-by: imjustprism, a reference link to the upstream PR #2427, and the missing module documentation. The benchmark figures have also been clarified in the description, specifying that they represent the accuracy of the original author's full branch.

**@⁠GaiuLulius** on GitHub · 2026-11-28 00:50 UTC · [original](https://github.com/uiliannn/VItoriaBr/pull/111#issuecomment-7231224822) Thanks for the correction and for pointing this out! You are absolutely right. The commit has been updated to include `Co-authored-by: imjustprism`, a reference link to the upstream PR #2427, and the missing module documentation. The benchmark figures have also been clarified in the description, specifying that they represent the accuracy of the original author's full branch.
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/111/head:github-bot/gh-111'
git switch 'github-bot/gh-111'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-111'
git switch 'github-bot/gh-111'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-111'
git switch 'github-bot/gh-111'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-111'
git switch 'main'
git merge --squash 'github-bot/gh-111'
git switch 'main'
git merge --ff-only 'github-bot/gh-111'
git switch 'main'
git merge 'github-bot/gh-111'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.