Preserve pending pipeline records on write failure #2249

Merged
LucaruluDev merged 2 commits from upstream-pr/2249 into main 2026-11-30 14:12:03 +00:00
LucaruluDev commented 2026-11-29 11:02:53 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by LucaruluDev on 2026-11-29T11:02:53Z.


What it changes

The pipeline book can lose pending records when
opening or writing its cache files fails.

This change:

  • Keeps unwritten records queued for retry.
  • Writes shader batches before their pipeline records.
  • Avoids duplicating successfully written shader data
    when a subsequent pipeline write fails.
  • Rolls back partial writes to the original file length.
  • Stops appending to a file if rollback fails.
  • Limits pending encoded payload to 64 MiB, including
    records currently being written.
  • Preserves batched I/O and releases completed buffers.

On Windows, an append-only file handle can fail
truncation with ERROR_ACCESS_DENIED (5).
The revised implementation opens the file with
write access and seeks to its end.

How it was tested

Hardware: Ryzen 7 9700X, RTX 5070 12 GB,
32 GiB DDR5, Windows 11.

  • 14 focused tests passed.
  • Pipeline suite: 79 passed, 2 ignored.
  • Real Windows temporary file rollback verified.
  • Synthetic partial-write and rollback-failure tests.
  • Concurrent pipeline recording during an active flush.
  • Pending byte-budget and deduplication tests.
  • Clippy completed with unrelated repository warnings.

Synthetic buffered file I/O benchmark,
median of seven runs per mode:

Records Upstream Patched
1,000 0.318 ms 0.741 ms
5,000 0.865 ms 1.540 ms

Batched writes are preserved, with a small additional
cost for recoverable write handling.

No shader changes.

Limitations

This change assumes a single pipeline book writer.

It handles reported I/O failures but does not
guarantee persistence across power loss or abrupt
process termination.

The 64 MiB limit applies to pending encoded payload,
not total process memory.

Gameplay performance has not been measured.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.

AI-assisted implementation and validation using
Claude Code and OpenAI Codex.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5550074445 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2249). Originally posted by [LucaruluDev](https://github.com/LucaruluDev) on 2026-11-29T11:02:53Z. --- ## What it changes The pipeline book can lose pending records when opening or writing its cache files fails. This change: - Keeps unwritten records queued for retry. - Writes shader batches before their pipeline records. - Avoids duplicating successfully written shader data when a subsequent pipeline write fails. - Rolls back partial writes to the original file length. - Stops appending to a file if rollback fails. - Limits pending encoded payload to 64 MiB, including records currently being written. - Preserves batched I/O and releases completed buffers. On Windows, an append-only file handle can fail truncation with ERROR_ACCESS_DENIED (5). The revised implementation opens the file with write access and seeks to its end. ## How it was tested Hardware: Ryzen 7 9700X, RTX 5070 12 GB, 32 GiB DDR5, Windows 11. - 14 focused tests passed. - Pipeline suite: 79 passed, 2 ignored. - Real Windows temporary file rollback verified. - Synthetic partial-write and rollback-failure tests. - Concurrent pipeline recording during an active flush. - Pending byte-budget and deduplication tests. - Clippy completed with unrelated repository warnings. Synthetic buffered file I/O benchmark, median of seven runs per mode: | Records | Upstream | Patched | |---|---:|---:| | 1,000 | 0.318 ms | 0.741 ms | | 5,000 | 0.865 ms | 1.540 ms | Batched writes are preserved, with a small additional cost for recoverable write handling. No shader changes. ## Limitations This change assumes a single pipeline book writer. It handles reported I/O failures but does not guarantee persistence across power loss or abrupt process termination. The 64 MiB limit applies to pending encoded payload, not total process memory. Gameplay performance has not been measured. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. AI-assisted implementation and validation using Claude Code and OpenAI Codex.
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!2249
No description provided.