[pr-fix][memory][startup] Read single-string Windows page-file settings #308

Open
andrewpozdnakov7-jpg wants to merge 1 commit from andrewpozdnakov7-jpg/Darner:fix/306-system-managed-pagefiles into main
First-time contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

Both Darner reads of PagingFiles restrict RegGetValueW to REG_MULTI_SZ. A REG_SZ value such as ?:\pagefile.sys is rejected, so the residency budget misses system-managed growth and the startup memory check cannot read the page-file configuration. The same two type flags are now accepted in the size and data queries. The existing parsers handle the strings.

Fixes #306.

Ported from VIctory-NVIDIA #4066 by jebaczydow, credited as co-author. Darner port by andrewpozdnakov7-jpg (GitHub profile). If reusing this commit, please retain the Git author and the original co-author trailer.

How it was tested

  • Tested revision: bd123e9 on f3840d7.
  • Commands and results: A Windows fixture used the production type masks on a disposable current-user registry key. Main rejected REG_SZ in both readers and this revision read it in both. A two-entry REG_MULTI_SZ passed on both revisions, and REG_BINARY was rejected on both. cargo check --offline --locked -p darner-gpu --lib --tests, cargo xtask policy, and git diff --check passed.
  • Changes a default: no.
  • Independent Windows verification of bd123e9: both workspace Clippy gates and asset policy passed. All 12 residency tests and 11 Streamline tests passed. Full workspace tests and gameplay remain outside that check.
  • Coverage gaps: The registry fixture uses the real Windows API and does not change the system page-file configuration. No game or device run was needed to check registry type acceptance. Game commit headroom was not measured.

Checklist

  • I ran this change in the game.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #283 and #168 also change Streamline code, outside the registry reader.
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: <!-- optional --> ## What it changes Both Darner reads of PagingFiles restrict RegGetValueW to REG_MULTI_SZ. A REG_SZ value such as ?:\pagefile.sys is rejected, so the residency budget misses system-managed growth and the startup memory check cannot read the page-file configuration. The same two type flags are now accepted in the size and data queries. The existing parsers handle the strings. Fixes #306. Ported from [VIctory-NVIDIA #4066](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4066) by [jebaczydow](https://github.com/jebaczydow), credited as co-author. Darner port by [andrewpozdnakov7-jpg](https://git.gtahub.st/andrewpozdnakov7-jpg) ([GitHub profile](https://github.com/andrewpozdnakov7-jpg)). If reusing this commit, please retain the Git author and the original co-author trailer. ## How it was tested - Tested revision: bd123e9 on f3840d7. - Commands and results: A Windows fixture used the production type masks on a disposable current-user registry key. Main rejected REG_SZ in both readers and this revision read it in both. A two-entry REG_MULTI_SZ passed on both revisions, and REG_BINARY was rejected on both. cargo check --offline --locked -p darner-gpu --lib --tests, cargo xtask policy, and git diff --check passed. - Changes a default: no. - [Independent Windows verification of bd123e9](https://git.gtahub.st/TrustNo1/Darner/pulls/308#issuecomment-868211): both workspace Clippy gates and asset policy passed. All 12 residency tests and 11 Streamline tests passed. Full workspace tests and gameplay remain outside that check. - Coverage gaps: The registry fixture uses the real Windows API and does not change the system page-file configuration. No game or device run was needed to check registry type acceptance. Game commit headroom was not measured. ## Checklist - [ ] I ran this change in the game. - [x] This PR contains one change based on main. - [x] The diff follows docs/asset-policy.md. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #283 and #168 also change Streamline code, outside the registry reader. - Replaces or overlaps: none found
Port the registry type filter from VIctory-NVIDIA #4066. Accept REG_SZ in both Darner readers and retain the existing REG_MULTI_SZ parsing.

Co-authored-by: jebaczydow <[email protected]>
First-time contributor

Independent Windows build, gate, and code-read review of bd123e95d387 (full head bd123e95d387372aa35929cd4769f0e275fc2402), based on main f3840d73d3504c30218debfbc8795b9225447317. Not run in-game.

Environment

  • Windows 11 Pro 26H2 (build 26300.10075), Intel Core i9-14900K, NVIDIA RTX A2000 12GB (driver 621.47), Rust 1.98.1 (x86_64-pc-windows-msvc), MSVC 19.44.35230.

Measured results

  • Gate 1 (cargo clippy --workspace --all-targets --locked -- -D warnings): PASS.
  • Gate 2 (cargo clippy --workspace --all-targets --all-features --locked -- -D warnings): PASS.
  • cargo xtask policy: PASS (asset policy: 555 files ok).
  • cargo test --locked -p darner-gpu --lib residency::tests: PASS (12 passed; 0 failed; 0 ignored).
  • cargo test --locked -p darner-gpu --lib streamline::tests: PASS (11 passed; 0 failed; 0 ignored).
  • Full workspace test gate (cargo test --workspace --locked) and gameplay were not run in this review.

Code-read audit

  • Both pagefiles registry queries use the same REG_MULTI_SZ | REG_SZ type mask for size discovery and data retrieval, while retaining the existing error/empty fallback and bounded UTF-16 buffer handling (crates/darner-gpu/src/residency.rs:112-151). Its parser splits the returned string data on NUL, accepts the system-managed ?: root and optional sizes, and derives the configured maximum as before (residency.rs:155-170).
  • ram_and_page_files applies the same type mask to both RegGetValueW calls, sizes its buffer from the query, truncates to the returned UTF-16 length, and filters empty strings after splitting—covering both one REG_SZ entry and REG_MULTI_SZ entries (crates/darner-gpu/src/streamline.rs:1202-1236).
  • The change is limited to accepted registry value types; it does not alter page-file parsing, memory-budget calculations, or the system configuration. The existing residency and Streamline unit suites passed. The PR description reports a disposable-key Windows API check for REG_SZ, REG_MULTI_SZ, and REG_BINARY; I did not independently repeat that fixture.

No blocking issue found.

Verdict: PASS.

AI-assisted: yes (GitHub Copilot, Auto mode).

Independent Windows build, gate, and code-read review of `bd123e95d387` (full head `bd123e95d387372aa35929cd4769f0e275fc2402`), based on `main` `f3840d73d3504c30218debfbc8795b9225447317`. Not run in-game. ### Environment - Windows 11 Pro 26H2 (build 26300.10075), Intel Core i9-14900K, NVIDIA RTX A2000 12GB (driver 621.47), Rust 1.98.1 (`x86_64-pc-windows-msvc`), MSVC 19.44.35230. ### Measured results - Gate 1 (`cargo clippy --workspace --all-targets --locked -- -D warnings`): **PASS**. - Gate 2 (`cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`): **PASS**. - `cargo xtask policy`: **PASS** (`asset policy: 555 files ok`). - `cargo test --locked -p darner-gpu --lib residency::tests`: **PASS** (`12 passed; 0 failed; 0 ignored`). - `cargo test --locked -p darner-gpu --lib streamline::tests`: **PASS** (`11 passed; 0 failed; 0 ignored`). - Full workspace test gate (`cargo test --workspace --locked`) and gameplay were not run in this review. ### Code-read audit - Both `pagefiles` registry queries use the same `REG_MULTI_SZ | REG_SZ` type mask for size discovery and data retrieval, while retaining the existing error/empty fallback and bounded UTF-16 buffer handling (`crates/darner-gpu/src/residency.rs:112-151`). Its parser splits the returned string data on NUL, accepts the system-managed `?:` root and optional sizes, and derives the configured maximum as before (`residency.rs:155-170`). - `ram_and_page_files` applies the same type mask to both `RegGetValueW` calls, sizes its buffer from the query, truncates to the returned UTF-16 length, and filters empty strings after splitting—covering both one `REG_SZ` entry and `REG_MULTI_SZ` entries (`crates/darner-gpu/src/streamline.rs:1202-1236`). - The change is limited to accepted registry value types; it does not alter page-file parsing, memory-budget calculations, or the system configuration. The existing residency and Streamline unit suites passed. The PR description reports a disposable-key Windows API check for `REG_SZ`, `REG_MULTI_SZ`, and `REG_BINARY`; I did not independently repeat that fixture. No blocking issue found. **Verdict: PASS.** AI-assisted: yes (GitHub Copilot, Auto mode).
Contributor

Code review only (read the diff at bd123e95), nothing built or run. I agree with lewis499: both readers accept REG_SZ, and the parsers already handle one string.

  • What it changes in play, for testers with RAM or page-file trouble: it frees no memory. On PCs whose PagingFiles is a single string, commit_growth used to see no page file and count no growth. Now it counts how far Windows can still grow the file (capped at the volume's free space less 8 GB), so Darner reports "host memory pressure" later (fewer held texture uploads and sweeps). It is expected to help stutter and late textures, not running out of memory.

Reviewed with Claude Code (AI-assisted); findings checked by a human before posting.

Code review only (read the diff at `bd123e95`), nothing built or run. I agree with lewis499: both readers accept `REG_SZ`, and the parsers already handle one string. - What it changes in play, for testers with RAM or page-file trouble: it frees no memory. On PCs whose `PagingFiles` is a single string, `commit_growth` used to see no page file and count no growth. Now it counts how far Windows can still grow the file (capped at the volume's free space less 8 GB), so Darner reports "host memory pressure" later (fewer held texture uploads and sweeps). It is expected to help stutter and late textures, not running out of memory. Reviewed with Claude Code (AI-assisted); findings checked by a human before posting.
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 'fix/306-system-managed-pagefiles:andrewpozdnakov7-jpg-fix/306-system-managed-pagefiles'
git switch 'andrewpozdnakov7-jpg-fix/306-system-managed-pagefiles'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'andrewpozdnakov7-jpg-fix/306-system-managed-pagefiles'
git switch 'andrewpozdnakov7-jpg-fix/306-system-managed-pagefiles'
git rebase 'main'
git switch 'main'
git merge --ff-only 'andrewpozdnakov7-jpg-fix/306-system-managed-pagefiles'
git switch 'andrewpozdnakov7-jpg-fix/306-system-managed-pagefiles'
git rebase 'main'
git switch 'main'
git merge --no-ff 'andrewpozdnakov7-jpg-fix/306-system-managed-pagefiles'
git switch 'main'
git merge --squash 'andrewpozdnakov7-jpg-fix/306-system-managed-pagefiles'
git switch 'main'
git merge --ff-only 'andrewpozdnakov7-jpg-fix/306-system-managed-pagefiles'
git switch 'main'
git merge 'andrewpozdnakov7-jpg-fix/306-system-managed-pagefiles'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
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
TrustNo1/Darner!308
No description provided.