Preserve shader pages covered by contiguous pool mappings #657

Open
fruvs wants to merge 1 commit from upstream-pr/657 into main
fruvs commented 2026-11-29 22:30:44 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by fruvs on 2026-11-29T22:30:44Z.


What this changes

Refs #656

Coalesce adjacent native page-table mappings when both their title addresses and their offsets within the same backing pool are contiguous. This lets a 64 KiB shader page span several smaller mappings. A hole, a different backing pool, or a discontinuous pool offset keeps the page unmapped.

How it was tested

  • On an M5 Pro with Metal, the synthetic computed-address dispatch returned zero before the fix and all expected values after it. Removing one fragment made the next dispatch observe the hole.
  • The page-table test checks continuous backing, an offset jump, and a pool change.
  • Native renderer tests passed on the upstream base with this patch (331 passed, 6 ignored). Asset policy passed.
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings with the pinned Rust 1.98.1.
  • The broader macOS release suite's unordered-access-clear function-pointer assertion also fails on pristine upstream main. The Rosetta suite was outside this Metal validation. Game replay is pending.

Checklist

  • No game files, game code, disassembly listings or SDK files are included.
  • This does not change assumptions about undocumented console behavior.
  • This adds no runtime diagnostic.
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5555841346 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/657). Originally posted by [fruvs](https://github.com/fruvs) on 2026-11-29T22:30:44Z. --- ## What this changes Refs #656 Coalesce adjacent native page-table mappings when both their title addresses and their offsets within the same backing pool are contiguous. This lets a 64 KiB shader page span several smaller mappings. A hole, a different backing pool, or a discontinuous pool offset keeps the page unmapped. ## How it was tested - On an M5 Pro with Metal, the synthetic computed-address dispatch returned zero before the fix and all expected values after it. Removing one fragment made the next dispatch observe the hole. - The page-table test checks continuous backing, an offset jump, and a pool change. - Native renderer tests passed on the upstream base with this patch (331 passed, 6 ignored). Asset policy passed. - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` with the pinned Rust 1.98.1. - The broader macOS release suite's unordered-access-clear function-pointer assertion also fails on pristine upstream main. The Rosetta suite was outside this Metal validation. Game replay is pending. ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included. - [x] This does not change assumptions about undocumented console behavior. - [x] This adds no runtime diagnostic.
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/657:upstream-pr/657'
git switch 'upstream-pr/657'

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