feat(memory): track canonical section generations #408

Closed
krofty wants to merge 1 commit from upstream-pr/408 into main
krofty commented 2026-11-27 21:58:49 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by krofty on 2026-11-27T21:58:49Z.


The in-place census identifies physical pages by a reusable section handle and offset. That is insufficient for rejecting stale mappings, reused physical allocations or delayed write observations. GPU ownership needs a canonical identity before it can safely omit publication.

Add backing tokens, physical allocation incarnations, logical ranges, mapping epochs and observed byte-range versions. The existing alias census and identity bindings share one registry lock. Native sections retain one token for their lifetime; mapping callbacks carry it, stale explicit tokens are rejected before changing the census, and physical retirement/rearrangement runs inside mapping exclusion. Temporary physical I/O windows retain the actual section identity through their final write notification.

Write guards use a bounded atomic fault journal; mapping changes retain tombstones and fall back conservatively on incomplete observations. Native kernel writes report both beginning and completion. This reuses the identity core from our earlier shared-storage work without importing its retention/capture paths.

Refs #377 and Snaacky/ztrx#249. Affected files are storage.rs, its native CPU fixture, inplace.rs, watch.rs, lib.rs and xmem.rs.

Validation:

  • 26 identity regressions, eight existing census regressions and38 guard regressions pass.
  • A native CPU fixture maps two real aliases, checks shared write versions, executes a guarded store through the actual VEH, reincarnates physical pages and reuses a VA while rejecting stale leases.
  • Physical-window lifetime after PFN release and retirement exclusion against a live native mapping reader both pass.
  • Both affected crates compile with diagnostics and pass ordinary cargo check without diagnostics. New modules pass rustfmt; git diff --check passes. Unused metadata APIs produce warnings while ownership consumers remain pending.

Diagnostics build300 and fixed-world off/on runs321/322 passed closure with no reported errors. Last three host intervals were47.6/48.6/47.6ms off and47.0/46.3/48.3ms on; expected geometry is present in both pictures. This establishes initial compatibility, not an FPS gain or completed-frame distribution.

This is a foundation stage. tracking_complete remains false. No eager GPU readback, comparison or legacy refresh is skipped; GPU publication origin, full I/O leases, before-exposure mapping admission and GPU ownership are dependent work. No30FPS qualification is claimed. Draft PR remains open and unmerged.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5533627568 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/408). Originally posted by [krofty](https://github.com/krofty) on 2026-11-27T21:58:49Z. --- The in-place census identifies physical pages by a reusable section handle and offset. That is insufficient for rejecting stale mappings, reused physical allocations or delayed write observations. GPU ownership needs a canonical identity before it can safely omit publication. Add backing tokens, physical allocation incarnations, logical ranges, mapping epochs and observed byte-range versions. The existing alias census and identity bindings share one registry lock. Native sections retain one token for their lifetime; mapping callbacks carry it, stale explicit tokens are rejected before changing the census, and physical retirement/rearrangement runs inside mapping exclusion. Temporary physical I/O windows retain the actual section identity through their final write notification. Write guards use a bounded atomic fault journal; mapping changes retain tombstones and fall back conservatively on incomplete observations. Native kernel writes report both beginning and completion. This reuses the identity core from our earlier shared-storage work without importing its retention/capture paths. Refs #377 and Snaacky/ztrx#249. Affected files are storage.rs, its native CPU fixture, inplace.rs, watch.rs, lib.rs and xmem.rs. Validation: - 26 identity regressions, eight existing census regressions and38 guard regressions pass. - A native CPU fixture maps two real aliases, checks shared write versions, executes a guarded store through the actual VEH, reincarnates physical pages and reuses a VA while rejecting stale leases. - Physical-window lifetime after PFN release and retirement exclusion against a live native mapping reader both pass. - Both affected crates compile with diagnostics and pass ordinary cargo check without diagnostics. New modules pass rustfmt; git diff --check passes. Unused metadata APIs produce warnings while ownership consumers remain pending. Diagnostics build300 and fixed-world off/on runs321/322 passed closure with no reported errors. Last three host intervals were47.6/48.6/47.6ms off and47.0/46.3/48.3ms on; expected geometry is present in both pictures. This establishes initial compatibility, not an FPS gain or completed-frame distribution. This is a foundation stage. tracking_complete remains false. No eager GPU readback, comparison or legacy refresh is skipped; GPU publication origin, full I/O leases, before-exposure mapping admission and GPU ownership are dependent work. No30FPS qualification is claimed. Draft PR remains open and unmerged.

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
trustno1-coder/VIctory-NVIDIA!408
No description provided.