Native shader page table drops fully backed pages mapped in fragments #656

Open
opened 2026-11-29 22:30:22 +00:00 by fruvs · 2 comments
fruvs commented 2026-11-29 22:30:22 +00:00 (Migrated from github.com)
Contributor

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


A translated shader can read zero from a fully backed 64 KiB page if the title supplies it as four adjacent 16 KiB mappings. The native page-table builder rounds the start and end of each mapping independently, so none of those fragments contributes a table entry.

A synthetic Metal dispatch reproduces the bad read without any game files. The source and destination live in the same test pool. After splitting the source mapping into four adjacent fragments, the first result is zero instead of 48,880.

The proposed fix lets adjacent virtual mappings supply one page when they refer to contiguous bytes of the same backing pool. It leaves a null page for holes, pool changes and noncontiguous backing offsets. The regression also removes one fragment after a successful dispatch and checks the next dispatch observes the hole.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6685034715 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/656). Originally posted by [fruvs](https://github.com/fruvs) on 2026-11-29T22:30:22Z. --- A translated shader can read zero from a fully backed 64 KiB page if the title supplies it as four adjacent 16 KiB mappings. The native page-table builder rounds the start and end of each mapping independently, so none of those fragments contributes a table entry. A synthetic Metal dispatch reproduces the bad read without any game files. The source and destination live in the same test pool. After splitting the source mapping into four adjacent fragments, the first result is zero instead of 48,880. The proposed fix lets adjacent virtual mappings supply one page when they refer to contiguous bytes of the same backing pool. It leaves a null page for holes, pool changes and noncontiguous backing offsets. The regression also removes one fragment after a successful dispatch and checks the next dispatch observes the hole.
fruvs commented 2026-11-29 22:30:28 +00:00 (Migrated from github.com)
Author
Contributor

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


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7263726885 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/656#issuecomment-7263726885). Originally posted by [fruvs](https://github.com/fruvs) on 2026-11-29T22:30:28Z. --- /claim
github-actions[bot] commented 2026-11-29 22:30:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-29T22:30:37Z.


Claimed by @fruvs. Open a draft pull request with Refs #656 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7263728991 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/656#issuecomment-7263728991). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T22:30:37Z. --- Claimed by @fruvs. Open a draft pull request with `Refs #656` in its description within 24 hours, or the claim expires.
Sign in to join this conversation.
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#656
No description provided.