Skip to content

compilemem: skip learning when private bytes are unavailable (#2408) - #2586

Open
fainty0 wants to merge 1 commit into
trustno1-coder:mainfrom
fainty0:fix/2408-compile-memory
Open

fainty0 wants to merge 1 commit into
trustno1-coder:mainfrom
fainty0:fix/2408-compile-memory

Conversation

@fainty0

@fainty0 fainty0 commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #2408

What it changes

Wine can return a short response and leave PrivateUsage unwritten. Check the returned size and a sentinel; skip estimator updates when either endpoint is unavailable, but still retire the compile. Genuine zero remains valid. Do not substitute PagefileUsage: on Wine the issue's synthetic control saw it rise only after touching the pages, not on commit.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): none; no GPU or game.
  • Before: the short response was read as zero; the estimator could learn a zero-byte compile from missing data.
  • After: host unit test passed for full, short, unwritten and genuine-zero responses. Windows-target Clippy was compared against clean 829188e: default 5→5 and all-features 4→4 with --keep-going, no added or removed diagnostics. GPU-only Clippy also had no diagnostic changes. Staged asset policy passed.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): not applicable.
  • cargo test passed for the crates it touches: no. The isolated parser unit test passed via rustc --test; full Linux workspace tests are blocked by existing Windows-only imports. Windows tests not run (no Windows); no Proton/runtime verification.

Checked for overlap

Co-authored-by: Andrei Turcan <360425173+fainty0@users.noreply.github.com>
@github-actions github-actions Bot added the pr-fix Pull request: fixes a bug label Nov 29, 2026
@github-actions github-actions Bot changed the title [pr-fix] compilemem: skip learning when private bytes are unavailable (#2408) compilemem: skip learning when private bytes are unavailable (#2408) Nov 29, 2026

@fretuil fretuil left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed a1f619d — looks solid and well-tested overall.

What looks good:

  • Handling partial PROCESS_MEMORY_COUNTERS_EX responses via both the returned cb size check and the UNWRITTEN sentinel safely covers both ways Wine can leave PrivateUsage unpopulated.
  • Retiring compiles in State::finish when either endpoint is None prevents polluting the estimator while keeping finished counters accurate.
  • Tightening Process and process_memory visibility to module-private and adding unit tests for short cb responses and missing endpoints is very clean.

Minor nits (optional):

  • In State::try_start, initializing peak_private: private.unwrap_or(0) instead of 0 would keep peak_private >= private_at_start true before the first sample() call (even though saturating_sub in finish already produces the right result).
  • In line(), when p.private is None, the log reads "process unavailable private"; "process N/A private" or "process private unavailable" might scan a bit more naturally in logs.

moritz-eckhard-nickel added a commit to moritz-eckhard-nickel/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
moritz-eckhard-nickel added a commit to moritz-eckhard-nickel/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
…bytes (compilemem::process_memory pub(crate))

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-fix Pull request: fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile-memory estimator learns from unavailable PrivateUsage on Proton

2 participants