The inplace gate enforces the module's own rule about late wait #1363

Open
HailLucifer666 wants to merge 9 commits from upstream-pr/1363 into main
HailLucifer666 commented 2026-11-28 18:03:50 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by HailLucifer666 on 2026-11-28T18:03:50Z.


inplace.rs's own doc has said it since before this fork existed: "Do not combine 2 with late wait" — stage 2 places buffers over title memory and assumes every submission is waited for, and VICTORY_LATE_WAIT does not wait, so a buffer a flight still writes can be handed the title with its shader writes in flight. Nothing enforced it: asking for the combination got the hazard, silently, on every start.

The change: safe_level(asked, late_wait) — VICTORY_INPLACE=2 with VICTORY_LATE_WAIT runs at 1, which assumes nothing about waits; everything else passes exactly as asked. level() applies the gate at its single read site, and the OnceLock makes the warning once (asked level, running level, and the reason quoted from the module's own rule).

Tests and probes (inplace::tests::an_inplace_level_of_2_with_late_wait_runs_at_1): the forbidden combination runs at 1; 2 alone, 1 with late wait, and 0 all pass through exactly as asked. Both mutation probes ran red and were restored, recorded in the test file: the fallback changed to 2 (a no-op gate), and the level-2 condition changed to late-wait-only (which would wrongly downgrade 1).

Local: victory-gpu 466 passed / 0 failed / 36 ignored, clippy --all-targets --all-features -D warnings clean. Stacks on #1290 → #1294 → #1326 → #1328 → #1348 → #1357 → #1360.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5543109423 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1363). Originally posted by [HailLucifer666](https://github.com/HailLucifer666) on 2026-11-28T18:03:50Z. --- `inplace.rs`'s own doc has said it since before this fork existed: *"Do not combine 2 with late wait"* — stage 2 places buffers over title memory and assumes every submission is waited for, and `VICTORY_LATE_WAIT` does not wait, so a buffer a flight still writes can be handed the title with its shader writes in flight. **Nothing enforced it**: asking for the combination got the hazard, silently, on every start. **The change**: `safe_level(asked, late_wait)` — `VICTORY_INPLACE=2` with `VICTORY_LATE_WAIT` runs at **1**, which assumes nothing about waits; everything else passes exactly as asked. `level()` applies the gate at its single read site, and the `OnceLock` makes the warning once (asked level, running level, and the reason quoted from the module's own rule). **Tests and probes** (`inplace::tests::an_inplace_level_of_2_with_late_wait_runs_at_1`): the forbidden combination runs at 1; 2 alone, 1 with late wait, and 0 all pass through exactly as asked. **Both mutation probes ran red and were restored, recorded in the test file**: the fallback changed to 2 (a no-op gate), and the level-2 condition changed to late-wait-only (which would wrongly downgrade 1). Local: victory-gpu **466 passed / 0 failed / 36 ignored**, clippy `--all-targets --all-features -D warnings` clean. Stacks on #1290 → #1294 → #1326 → #1328 → #1348 → #1357 → #1360.
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/1363:upstream-pr/1363'
git switch 'upstream-pr/1363'

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