Serialize pipeline book appends across running instances #4892

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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 13:04 UTC · original
andrewpozdnakov7-jpg:codex2/fix/serialize-book-writers → main · +12 −4 · 1 files · 1 commits · open

What it changes

The pipeline-book writer opens a file, seeks to the end, and remembers that length for rollback. Two running instances can open the same file and seek to the same offset. The second write can replace records written by the first.

This change lets one Windows handle write the file at a time, from the initial seek through any rollback. Other instances keep their records in the existing retry queue when the file is busy. Readers can still open the book during the write.

How it was tested

  • One Windows Rust fixture ran the exact open_append from main 5fabb46e and 812c0c63ee5cfdb723effc23edd4a8cd36a355ab against a synthetic file with two independent handles. Release e1251c31 has the same open_append as main.
  • Before, both handles recorded offset 5. The second replaced the first new record. After, the overlapping open returned a sharing violation. Once the first writer closed, the retry reopened at offset 11 and both records were present.
  • A reader remained open for the sequence, and the first writer could roll back a partial append before storing its record. cargo xtask policy --staged accepted the source file.
  • Main's CI check has five existing Clippy errors tracked in #4708.

Checked for overlap

  • Searched open and closed issues and PRs for concurrent writers and book appends. #2249 preserves records after write or rollback failures. #4869 concerns the startup reader and tail repair.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 13:04 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4891) `andrewpozdnakov7-jpg:codex2/fix/serialize-book-writers` → `main` · +12 −4 · 1 files · 1 commits · open ## What it changes The pipeline-book writer opens a file, seeks to the end, and remembers that length for rollback. Two running instances can open the same file and seek to the same offset. The second write can replace records written by the first. This change lets one Windows handle write the file at a time, from the initial seek through any rollback. Other instances keep their records in the existing retry queue when the file is busy. Readers can still open the book during the write. ## How it was tested - One Windows Rust fixture ran the exact `open_append` from main `5fabb46e` and `812c0c63ee5cfdb723effc23edd4a8cd36a355ab` against a synthetic file with two independent handles. Release `e1251c31` has the same `open_append` as main. - Before, both handles recorded offset 5. The second replaced the first new record. After, the overlapping open returned a sharing violation. Once the first writer closed, the retry reopened at offset 11 and both records were present. - A reader remained open for the sequence, and the first writer could roll back a partial append before storing its record. `cargo xtask policy --staged` accepted the source file. - Main's [CI check](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46563306780/job/142355972539) has five existing Clippy errors tracked in #4708. ## Checked for overlap - [x] Searched open and closed issues and PRs for concurrent writers and book appends. #2249 preserves records after write or rollback failures. #4869 concerns the startup reader and tail repair. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:04:57 +00:00
github-bot changed title from [pr-fix][shaders] Serialize pipeline book appends across running instances to Serialize pipeline book appends across running instances 2026-12-01 13:10:28 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-12-01 16:23 UTC · original · approved these changes

Reviewed crates/victory-gpu/src/pipeline/known.rs: opening the pipeline book with FILE_SHARE_READ via OpenOptionsExt::share_mode serializes concurrent writers from seek through potential set_len rollback while still allowing concurrent readers. Verified on Windows (RTX 5090): cargo test -p victory-gpu --lib pipeline::known::tests -- --test-threads=1 (14 passed, 0 failed).

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-12-01 16:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4891#pullrequestreview-6135369983) · **approved these changes** Reviewed crates/victory-gpu/src/pipeline/known.rs: opening the pipeline book with FILE_SHARE_READ via OpenOptionsExt::share_mode serializes concurrent writers from seek through potential set_len rollback while still allowing concurrent readers. Verified on Windows (RTX 5090): cargo test -p victory-gpu --lib pipeline::known::tests -- --test-threads=1 (14 passed, 0 failed). Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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/4892/head:github-bot/gh-4891'
git switch 'github-bot/gh-4891'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4891'
git switch 'github-bot/gh-4891'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4891'
git switch 'github-bot/gh-4891'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4891'
git switch 'main'
git merge --squash 'github-bot/gh-4891'
git switch 'main'
git merge --ff-only 'github-bot/gh-4891'
git switch 'main'
git merge 'github-bot/gh-4891'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4892
No description provided.