Metal shader library loading requires a writable temporary directory #649

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

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by fruvs on 2026-11-29T04:08:41Z.


The Metal backend writes a converted shader library to a temporary file before loading it. Pipeline creation can fail if the temporary directory is unavailable, even when the library bytes are already available in memory.

On an Apple M5 Pro, the synthetic test metal::tests::queue_b_waits_for_queue_a_over_the_same_buffer passes normally on main. Running the compiled test under a macOS sandbox profile with (deny file-write*), with VICTORY_MSC_DYLIB set and VICTORY_NO_PIPELINE_ARCHIVE=1, reproduces Operation not permitted (os error 1) during library loading.

The proposed change loads an owned dispatch-data buffer with newLibraryWithData:error:. The compute test and the synthetic indexed draw with depth sampling both pass under the same write restriction on the patched build.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6674661927 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/649). Originally posted by [fruvs](https://github.com/fruvs) on 2026-11-29T04:08:41Z. --- The Metal backend writes a converted shader library to a temporary file before loading it. Pipeline creation can fail if the temporary directory is unavailable, even when the library bytes are already available in memory. On an Apple M5 Pro, the synthetic test `metal::tests::queue_b_waits_for_queue_a_over_the_same_buffer` passes normally on main. Running the compiled test under a macOS sandbox profile with `(deny file-write*)`, with `VICTORY_MSC_DYLIB` set and `VICTORY_NO_PIPELINE_ARCHIVE=1`, reproduces `Operation not permitted (os error 1)` during library loading. The proposed change loads an owned dispatch-data buffer with `newLibraryWithData:error:`. The compute test and the synthetic indexed draw with depth sampling both pass under the same write restriction on the patched build.
fruvs commented 2026-11-29 04:09:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by fruvs on 2026-11-29T04:09:17Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7250480981 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/649#issuecomment-7250480981). Originally posted by [fruvs](https://github.com/fruvs) on 2026-11-29T04:09:17Z. --- /claim
github-actions[bot] commented 2026-11-29 04:09:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-29T04:09:28Z.


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

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7250482688 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/649#issuecomment-7250482688). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T04:09:28Z. --- Claimed by @fruvs. Open a draft pull request with `Refs #649` 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#649
No description provided.