gpu(watch,shadow): coalesce consecutive dirty 4 KiB page parts via part_runs #257
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
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
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
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/Androtim--MiniVI!257
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/257/head"
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?
@Androtim on GitHub · 2026-11-30 13:37 UTC · original
Androtim:feat/iter251-watch-shadow-coalesce-part-runs→main· +43 −8 · 2 files · 1 commits · merged 2026-11-30 14:04 UTCSummary
watch::part_runs(parts: u16)to iterate consecutive dirty 4 KiB sub-page runs within each 64 KiB page directly as coalesced[first, end)ranges.by_partsloop incrates/victory-gpu/src/shadow.rs(avoiding adjacent range merge overhead for consecutive dirty 4 KiB parts) and the duplicate bit-scanning loop inTrackedincrates/victory-gpu/src/watch.rs.part_runs_cover_exactly_the_written_partscovering all0..=u16::MAXpart masks.Verification
cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy->asset policy: 313 files okcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib watch:: -- --test-threads=1->53 passed; 0 failedcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib shadow:: -- --test-threads=1->47 passed; 0 failed; 3 ignoredcargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings-> cleancargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings-> clean@Androtim on GitHub · 2026-11-30 14:02 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
merge-candidate· CI (check):passingSummary
Clean, self-contained refactor extracting
watch::part_runs(parts: u16)to iterate maximal contiguous 4 KiB dirty sub-page runs within a 64 KiB page and reusing it in bothshadow::by_partsandwatch::Tracked::take.Code Review
crates/victory-gpu/src/watch.rs(part_runs,Tracked::take):parts: u16tou32guarantees bits16..32stay0, sofirst <= 15,end <= 16, andu32::MAX << endis always in-bounds without needing the previousif past >= PARTS/past.min(PARTS)guards.shifted & 2 == 0withremaining &= remaining - 1) and multi-bit path (shifted.trailing_ones()) cover all cases cleanly.parts_tests::part_runs_cover_exactly_the_written_partsexhaustively verifies all0..=u16::MAXmasks for bounds (first < end <= PARTS), strict non-adjacency/ordering (previous_end < first), and exact bit reconstruction.crates/victory-gpu/src/shadow.rs(by_parts):(0..16).filter(...)loop withcrate::watch::part_runs(parts)produces identical clipped[a, b)intervals while avoiding redundant intra-page merges; cross-page coalescing viaout.last_mut()is preserved.part_runscoalescing as part of a larger bundle; PR #257 isolates just this helper cleanly onmain.Verdict
merge-candidate— CI is passing, the transformation is mathematically equivalent across all 65,536u16masks (exhaustively unit-tested), and it does not alter GPU/D3D12/shader behavior, so no local GPU smoke test is required.Generated with Antigravity CLI (
agy).