gpu(native): back off unchanged whole texture checks and skip doomed partial reads #232
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!232
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-232"
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?
@Sheffy007 on GitHub · 2026-11-27 02:11 UTC · original
Sheffy007:perf/native-texture-sync-whole-checks→main· +222 −32 · 3 files · 2 commits · merged 2026-11-27 02:33 UTCAddresses the two open texture-sync bottlenecks noted on #179 (tracked under #15):
Unchanged whole checks filling
WHOLE_BUDGET(~410 MiB/s):On GFX10 tiled mipmapped textures (
victory_formats::texture::Layout::tiled), the 64 KiB mip tail sits at the start of the allocation (with unused padding at byte 0 when fewer than all 12 tail slots are occupied) while the finest mips occupy the upper ~75% and remainVM_PROT_NONEwhile coarse mips stream in. When coarse mips are written, the 8 sampled probe windows miss the write, settingsampled_sees_writes = false. Previously,sampled_sees_writesstayedfalseacross all 600 hot probes even when subsequent whole reads found nothing changed, queueing every-probe whole reads outsideWHOLE_SPAREup toWHOLE_BUDGET(8 MiB/submission).t.last == Some(r.hash)), returnsampled_sees_writestotrue(bounded byWHOLE_SPARE) and double the periodic check interval across consecutive unchanged whole checks (unchanged_whole, up toWHOLE_EVERY << 5= 256 probes) while the background scanner continues watching every texture.Partially-mapped texture reads (
Tracked::partial,Watch::partial):read_intocall rather than blind 1 MiB slices.partial) in bothTrackedandWatch, skipping the initial full-rangemach_vm_read_overwritethat copies the mapped prefix in the kernel only to fail at the unmapped fine mips, and zeroing only the unmapped/non-readable gaps instead of upfront zeroing the entire buffer before overwriting readable spans.partialautomatically onceread_texture_chunkobserves every byte covered by readable regions again.Tests & Verification
native::tests::texture_tests::a_missed_write_not_followed_by_another_backs_off_whole_reads(verifies 64 idle submissions after a missed-sample write perform <= 4 whole reads instead of 64, while preserving existing immediate next-submission burst tests).native::textures::tests::a_known_partial_chunk_skips_the_whole_read_until_every_page_is_readable.cargo test -p victory-gpu -p victory-metal -p victory-hle -p victory -p victory-shader -p xtask(784 passed, 0 failed, 4 ignored)cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warningscargo xtask policycargo build --release --target x86_64-apple-darwin -p victory@LakshanSivakumar on GitHub · 2026-11-27 02:33 UTC · original · approved these changes
Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!