gpu(native): resolve buffer ranges that run over adjacent pool mappings #53
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!53
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/53/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?
@Sandile-0511 on GitHub · 2026-11-26 11:34 UTC · original
Sandile-0511:fix/pool-ranges-across-mappings→main· +63 −5 · 2 files · 4 commits · merged 2026-11-26 12:54 UTCWhat this changes
PoolTable::resolverefused any range that crossed from one mapping into the next, and its own comment said to merge them "if a title builds a buffer view across a map boundary". The HLE side reports the pages of one allocation one 64 KiB mapping at a time, so every buffer view that crosses a page edge was refused, and its heap entry was left unwritten ("a descriptor was not mirrored ... is not in a mapped pool").resolvenow follows mappings that continue each other both in title memory and in the same pool. A range over a gap, over two pools, or over mappings that are not next to each other in the pool is still refused, since one pointer cannot show it.Related: the story-mode load in #15 and my tester report #13.
How it was tested
cargo test -p victory-gpu --libon arm64: 146 passed, 0 failed, 1 ignored. New testa_range_over_adjacent_mappings_resolves_when_the_pool_continues(three pages in pool order, a non-contiguous next page, another pool, a wrapping length).cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings(clean, run on a Mac)cargo xtask policy(365 files ok)9733707): "a descriptor was not mirrored" lines fell from 2,417 to 33 in a 170 s run, and the run went from sitting on the loading screen after Confirm to reading story data again and binding the first world pipelines. Not run with this change alone on currentmain.Checklist
VICTORY_*variable and documented (none added)@LakshanSivakumar on GitHub · 2026-11-26 11:51 UTC · original · requested changes
Thanks for covering both title-address and pool-offset continuity. Please reject zero-length mappings or make the walk stop on one. A zero-length entry at the next address with the expected pool and offset currently hangs
resolveunder the table lock (crates/victory-gpu/src/native/memory.rs~115). Please also update the size guidance indocs/native-host.md(~239) to describe when a range can span title mappings.@Sandile-0511 on GitHub · 2026-11-26 12:30 UTC · original
Thanks, that was a real hang. The walk now stops at an empty mapping (
next.len == 0returnsNone), andan_empty_mapping_ends_the_walkcovers a zero-length entry at the next address with the pool and offset that would continue the first. Without the guard that test spins and never returns. I also extended item 5 under "Interfaces for the Metal backend" indocs/native-host.mdto say when a range can run over several title mappings and when it is refused.@LakshanSivakumar on GitHub · 2026-11-26 12:48 UTC · original · approved these changes
Thanks, the earlier requests are addressed and the checks pass (tests incl. Metal, Windows clippy, policy). Approved.