Skip to content

fix macOS segfaults in tests #8

Open
Mythra wants to merge 5 commits into
Exzap:mainfrom
Mythra:mythra/macos-segfault-fix
Open

fix macOS segfaults in tests #8
Mythra wants to merge 5 commits into
Exzap:mainfrom
Mythra:mythra/macos-segfault-fix

Conversation

@Mythra
Copy link
Copy Markdown

@Mythra Mythra commented Dec 17, 2025

Note

This PR builds ontop of #7 , and as a result the diff looks massive because of the enumerations being copied on the windows pr branch along with containing all the windows code.

I recommend just viewing the changes at: 9e99f68...f8d995e until the windows PR gets merged.
This way you see the small ~200 line pr.

this fixes the segfault when running tests while on macOS. this
roughly comes down to two rough classes of issues:

  1. macOS is a lot more strict around allocations, and enforcing that
    they seemingly are correct.
    • First macOS like windows, wants a size to be a power of two.
    • Second macOS enforces that size is not less than alignment.
      these seem small but were the cause of the 'SEGFAULTS'.
  2. macOS's standard library also is not a fan of modifying
    lists/sets/etc. AS they're being iterated. it did cause some small
    issues with tests, i've fixed the ones that the test suite exercised,
    but this is not necissarily all of them. If you're seeing improper
    compilations it may be best to look into other passes doing this.

this commit adds in support for building, and compiling shaders on
windows.
this fixes the segfault when running tests while on macOS. this
roughly comes down to two rough classes of issues:

1. macOS is a lot more strict around allocations, and enforcing that
   they seemingly are correct.
   - First macOS like windows, wants a size to be a power of two.
   - Second macOS enforces that size is not less than alignment.
   these seem small but were the cause of the 'SEGFAULTS'.
2. macOS's standard library also is not a fan of modifying
   lists/sets/etc. AS they're being iterated. it did cause some small
   issues with tests, i've fixed the ones that the test suite exercised,
   but this is not _necissarily_ all of them. If you're seeing improper
   compilations it may be best to look into other passes doing this.
this also fixes a potential for looping forever, although i was only
able to hit this with weirdly formatted vertex shaders that may not
have been valid. it still fixes the actual potential for it happening,
and frankly looks cleaner.
@Mythra Mythra force-pushed the mythra/macos-segfault-fix branch from da8fa22 to f8d995e Compare December 23, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant