Keep concurrent warm completion records readable #4958

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/4958 into main
andrewpozdnakov7-jpg commented 2026-12-01 15:29:09 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T15:29:09Z.


What it changes

Two warm processes can use the same cache. The formatted write to warm-done.txt sends the fingerprint, name and line breaks to the file in separate writes. If a second process appends between them, the warm-up can lose both completion records and make those pipelines again on a later launch.

Format each completion record before appending it, both for regular warming and after a shared pipeline library save. The record format and reader stay compatible with existing files.

How it was tested

  • A focused Windows fixture ran the exact append and read code from 5fabb46e and 4359d5176a41dd8a8eb9dcdcdd0632a10e21c3ae with two append handles to one synthetic file. It scheduled the second logical append after the first write call. Main issued four writes for a record and recovered neither new mark. The patch issued one and recovered both. The prior record stayed readable in both runs.
  • cargo xtask policy --staged accepted the one changed file. The change combined cleanly with #4823, #4840 and the proposed worker-launch patch on #4778.
  • Main's CI check has five existing Clippy errors tracked in #4707.

Checked for overlap

  • Searched issues and PRs for warm-done.txt, warm marks and concurrent appends. #4485 handles the preload record in preloaded.txt. #4891 handles the binary pipeline book. #4823 and #4840 handle selection before warming.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5588863538 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4958). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T15:29:09Z. --- ## What it changes Two warm processes can use the same cache. The formatted write to `warm-done.txt` sends the fingerprint, name and line breaks to the file in separate writes. If a second process appends between them, the warm-up can lose both completion records and make those pipelines again on a later launch. Format each completion record before appending it, both for regular warming and after a shared pipeline library save. The record format and reader stay compatible with existing files. ## How it was tested - A focused Windows fixture ran the exact append and read code from `5fabb46e` and `4359d5176a41dd8a8eb9dcdcdd0632a10e21c3ae` with two append handles to one synthetic file. It scheduled the second logical append after the first write call. Main issued four writes for a record and recovered neither new mark. The patch issued one and recovered both. The prior record stayed readable in both runs. - `cargo xtask policy --staged` accepted the one changed file. The change combined cleanly with #4823, #4840 and the proposed worker-launch patch on #4778. - Main's [CI check](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46563306780/job/142355972539) has five existing Clippy errors tracked in #4707. ## Checked for overlap - [x] Searched issues and PRs for `warm-done.txt`, warm marks and concurrent appends. #4485 handles the preload record in `preloaded.txt`. #4891 handles the binary pipeline book. #4823 and #4840 handle selection before warming. 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.
Dukestar69 commented 2026-12-01 16:23:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-12-01T16:23:12Z.

Review: APPROVED


Reviewed pps/victory/src/warm.rs: combining each completion mark into a single write_all buffer in ppend_done_mark prevents interleaved partial lines when multiple warm processes append to the shared cache. Verified on Windows: cargo test -p victory --bin victory warm::tests -- --test-threads=1 (12 passed, 0 failed).

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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6135370395 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4958#pullrequestreview-6135370395). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-12-01T16:23:12Z. **Review:** APPROVED --- Reviewed pps/victory/src/warm.rs: combining each completion mark into a single write_all buffer in ppend_done_mark prevents interleaved partial lines when multiple warm processes append to the shared cache. Verified on Windows: cargo test -p victory --bin victory warm::tests -- --test-threads=1 (12 passed, 0 failed). Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/4958:upstream-pr/4958'
git switch 'upstream-pr/4958'

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 'upstream-pr/4958'
git switch 'upstream-pr/4958'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/4958'
git switch 'upstream-pr/4958'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/4958'
git switch 'main'
git merge --squash 'upstream-pr/4958'
git switch 'main'
git merge --ff-only 'upstream-pr/4958'
git switch 'main'
git merge 'upstream-pr/4958'
git push origin 'main'
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!4958
No description provided.