Pipeline cache: verify content when accepting a racing publication #2828
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2828
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2828"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 21:35 UTC · original
andrewpozdnakov7-jpg:codex1/concurrent-cache-publication→main· +106 −18 · 1 files · 3 commits · open#1324 landed as
a73d59eand covers the case where another writer publishes the correct cache entry before Windows rejects the rename. This branch keeps that behavior and checks that the existing file contains the converted bytes before accepting it.The comparison uses bounded chunks on the failure path. An unreadable entry, a different length, or different content leaves the original publishing error available to the caller. The upstream handling of staging write failures is preserved.
f3578e3: the identical entry is reused, then an existingXYZfile is incorrectly accepted for outputABC.2dacec0: the identical file is reused, and the same-length and longer mismatches return an error. The recorded file is unchanged and staging files are cleaned up.Coordination claim · Windows file sharing rules
Please retain my Git author if moving the follow-up. If you fold the comparison or test extension into another commit, please add the following trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted with Codex. Synthetic Windows file test.
Review follow-up
The same Windows fixture on
2dacec0fails because a second lookup returns the existingXYZ. Withb80763c198d6b13ca97e7aa0ee354a6721cf43b0, a separately opened cache declines both mismatches while the reader blocks replacement, then publishesABCafter the reader closes. The next lookup hitsABC; the identical-output control still hits without conversion. An empty companion marker adds a file-presence check to hits. Byte comparison is confined to failed rename attempts.Six successful runs, all eight pipeline tests and four GPU shader-cache tests passed, plus formatting, strict pipeline Clippy, and policy.
@fuzeofficlal on GitHub · 2026-11-25 21:48 UTC · original
Verified
f8302c39on Windows 11:cargo xtask policy: 184 files ok;cargo clippy --locked -p victory-pipeline --all-targets -- -D warnings: 0 warnings.cargo test --locked -p victory-pipeline: 8/8 passed (includingan_open_concurrent_cache_entry_wins_only_if_identical).same_outputcleanly handles concurrent publication without full-file copies and removes&tmpon collision. Cleangit merge-treeagainstorigin/mainand #2797 (complementary acrossvictory-pipelineandvictory-loader).@andrewpozdnakov7-jpg on GitHub · 2026-11-25 22:23 UTC · original
I resolved the conflict after #1324 landed. 2dacec0 keeps the upstream staging-write behavior and adds the byte check on rename failure.
The same synthetic test on main
f3578e3acceptsXYZwhereABCwas converted. The update reuses the identical file and rejects both mismatch controls. Six paired runs, eight pipeline tests, strict Clippy, formatting, and asset policy passed. The prior verified commit stays in the branch history.Please preserve Git authorship if moving the comparison or test extension. If squashing it into another commit, please add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 23:15 UTC · original
Follow-up to the retry review in b80763c.
The same Windows fixture on
2dacec0fails because a second lookup returns the existingXYZ. Withb80763c198d6b13ca97e7aa0ee354a6721cf43b0, a separately opened cache declines both mismatches while the reader blocks replacement, then publishesABCafter the reader closes. The next lookup hitsABC; the identical-output control still hits without conversion. An empty companion marker adds a file-presence check to hits. Byte comparison is confined to failed rename attempts.Six successful runs, all eight pipeline tests and four GPU shader-cache tests passed, plus formatting, strict pipeline Clippy, and policy.
Please preserve the Git author if cherry-picking the fix or test. If folding either into another commit, please include
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.@Marvisak on GitHub · 2026-11-26 02:23 UTC · original · edited 2026-11-26 03:23 UTC
Automated triage for the maintainers.
Verdict: proposed close (was needs work). Thanks for checking the production caller and for the candid answer. As you found, the shader cache keys entries by translator source, encoding, loop limit and container bytes, and on a publication error it already returns the in-memory translation (#2055). There is no known case where two writers publish different bytes for the same key, so the byte comparison and the
.invalidmarker inCache::get_or_convert(crates/victory-pipeline/src/cache.rs) guard a case that does not occur, at the cost of an extratry_exists()on every hit. #1324's behaviour inmainstays as is, which matches your own suggestion to defer.This will be closed in 48 hours unless you push a change (for example, with a real case where the contents differ) or a maintainer removes the label.
CI: passing (
check).Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 02:29 UTC · original
Thanks for flagging the hot-path cost. I checked the production caller on
63bcca4: the shader cache keys entries by the translator source, encoding, loop limit, and container bytes. On a publication error it already returns the in-memory translation. The Windows test creates a mismatched entry deliberately while a reader holds it open. I have no production case where two conversions with that same key produce different bytes.The two reviews identify a trade-off. The failure-only comparison in
2dacec0has no extra I/O on hits, but the same test then returns the mismatched file on a second lookup.b80763ccovers that retry at the cost of the marker check on each hit. With no observed production case, I'd leave #1324 as the current behavior and defer this follow-up until there's evidence that the retry case matters.If you use the comparison or the Windows fixture later, please retain the original Git author. For a combined commit, please use:
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted with Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.