gpu(queue): add opt-in VICTORY_FOLD_FORCE_MS timeout past stalled folded work #136

Manually merged
github merged 1 commit from gh-pr/136/head into gh-pr/136/base 2026-12-01 20:12:34 +00:00
Owner

@⁠Androtim on GitHub · 2026-11-29 14:33 UTC · original
Androtim:feat/iter137-queue-behind-fold-force-ms → main · +92 −8 · 1 files · 1 commits · merged 2026-11-29 15:06 UTC

Summary

Adds an opt-in watchdog escape hatch in crates/victory-gpu/src/queue/behind.rs:

  • Adds VICTORY_FOLD_FORCE_MS=n (off by default) and Lane::past_folded() / State.stuck.
  • If a present waits behind folded work (whose parts are still unknown) for at least n ms, that present can advance past the stall while the folded entry remains queued on its queue until ready.
  • Resets stuck whenever any queue entry starts, and adds unit test a_present_goes_past_folded_work_only_after_the_limit.

Verification

  • cargo +1.98.1-x86_64-pc-windows-gnu xtask policy (303 files ok)
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- queue::behind:: (6 passed; 0 failed)
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings (0 warnings)
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics --locked -- -D warnings (0 warnings)
**@⁠Androtim** on GitHub · 2026-11-29 14:33 UTC · [original](https://github.com/Androtim/MiniVI/pull/136) `Androtim:feat/iter137-queue-behind-fold-force-ms` → `main` · +92 −8 · 1 files · 1 commits · merged 2026-11-29 15:06 UTC ### Summary Adds an opt-in watchdog escape hatch in `crates/victory-gpu/src/queue/behind.rs`: - Adds `VICTORY_FOLD_FORCE_MS=n` (off by default) and `Lane::past_folded()` / `State.stuck`. - If a present waits behind folded work (whose parts are still unknown) for at least `n` ms, that present can advance past the stall while the folded entry remains queued on its queue until ready. - Resets `stuck` whenever any queue entry starts, and adds unit test `a_present_goes_past_folded_work_only_after_the_limit`. ### Verification - `cargo +1.98.1-x86_64-pc-windows-gnu xtask policy` (`303 files ok`) - `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- queue::behind::` (`6 passed; 0 failed`) - `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings` (0 warnings) - `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics --locked -- -D warnings` (0 warnings)
Add opt-in `VICTORY_FOLD_FORCE_MS=n` (off by default) in `queue::behind::Lane` so a queued present can advance past folded work that stays stuck longer than `n` ms without unfolding, preventing watchdog timeouts during long cold pipeline builds while leaving folded work queued for when its fence clears.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:12:33 +00:00
github manually merged commit 93598eb110 into gh-pr/136/base 2026-12-01 20:12:34 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 15:04 UTC · original

Automated triage for the maintainers (not an approval).

Verdict: merge-candidate · CI (check): passing

Review Summary

Clean, well-scoped opt-in escape hatch in crates/victory-gpu/src/queue/behind.rs for advancing a queued Present past stalled folded work (Job::Lists) after VICTORY_FOLD_FORCE_MS.

What was checked

  • Default behavior unchanged: fold_force() returns None unless VICTORY_FOLD_FORCE_MS is set to a positive integer, so Lane::past_folded() returns None immediately when unset.
  • Scheduling & queue invariants:
    • In Lane::step(), when ready is None and folded is true, past_folded(limit) locates the oldest present before limit and tracks stall duration via State::stuck.
    • Once elapsed, only that Present entry is removed and executed (shows = true, runs = 0), while the folded entry and any subsequent work on its queue remain ordered in state.items until the folded work becomes ready and unfolds.
    • state.stuck is reset to None whenever any entry is popped (including unfolding or running work), and Lane::serve() already wakes every 1 ms via wait_timeout while state.items is non-empty, so the timeout fires promptly without extra wakeups.
  • Test coverage: a_present_goes_past_folded_work_only_after_the_limit uses lane.fold_force.set(...) directly (avoiding process-wide env mutation races) and verifies default blocking, pre-timeout blocking, post-timeout present advancement, and subsequent unfolding/drain ordering.
  • CI: Passing.

No bugs or regressions found. Looks ready as a merge candidate.


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-29 15:04 UTC · [original](https://github.com/Androtim/MiniVI/pull/136#issuecomment-7257799099) <!-- minivi-triage v1 head=93598eb11078fe759d709e6560b472a24e30c5fe verdict=merge-candidate ci=passing at=2026-11-29T15:05:00Z --> Automated triage for the maintainers (not an approval). **Verdict:** `merge-candidate` · **CI (`check`):** `passing` ### Review Summary Clean, well-scoped opt-in escape hatch in `crates/victory-gpu/src/queue/behind.rs` for advancing a queued `Present` past stalled folded work (`Job::Lists`) after `VICTORY_FOLD_FORCE_MS`. #### What was checked - **Default behavior unchanged**: `fold_force()` returns `None` unless `VICTORY_FOLD_FORCE_MS` is set to a positive integer, so `Lane::past_folded()` returns `None` immediately when unset. - **Scheduling & queue invariants**: - In `Lane::step()`, when `ready` is `None` and `folded` is `true`, `past_folded(limit)` locates the oldest present before `limit` and tracks stall duration via `State::stuck`. - Once elapsed, only that `Present` entry is removed and executed (`shows = true`, `runs = 0`), while the folded entry and any subsequent work on its queue remain ordered in `state.items` until the folded work becomes ready and unfolds. - `state.stuck` is reset to `None` whenever any entry is popped (including unfolding or running work), and `Lane::serve()` already wakes every 1 ms via `wait_timeout` while `state.items` is non-empty, so the timeout fires promptly without extra wakeups. - **Test coverage**: `a_present_goes_past_folded_work_only_after_the_limit` uses `lane.fold_force.set(...)` directly (avoiding process-wide env mutation races) and verifies default blocking, pre-timeout blocking, post-timeout present advancement, and subsequent unfolding/drain ordering. - **CI**: Passing. No bugs or regressions found. Looks ready as a merge candidate. --- _Generated with Antigravity CLI (`agy`)._
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/Androtim--MiniVI!136
No description provided.