Metal shader library loading requires a writable temporary directory #653

Open
opened 2026-11-29 04:13:19 +00:00 by github-bot · 2 comments
Owner

@⁠fruvs on GitHub · 2026-11-29 04:08 UTC · original

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** on GitHub · 2026-11-29 04:08 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/649) 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 04:13:20 +00:00
Author
Owner

@⁠fruvs on GitHub · 2026-11-29 04:09 UTC · original

/claim

**@⁠fruvs** on GitHub · 2026-11-29 04:09 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/649#issuecomment-7250480981) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-29 04:09 UTC · original

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

**@⁠github-actions[bot]** on GitHub · 2026-11-29 04:09 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/649#issuecomment-7250482688) Claimed by @⁠fruvs. Open a draft pull request with `Refs #649` in its description within 24 hours, or the claim expires.
This discussion has been locked. Commenting is limited to contributors.
No description provided.