Repository navigation
Conversation
v0lumehi
force-pushed
the
fix-gfx-tests
branch
from
October 24, 2026 11:11
59c30da to
5102c3a
Compare
…der_chain, t_defer_chain, t_mip_extent; t_zskip and t_xv built the same way). The tests build tex_t values by hand with no pool, and tex_mtl shares one Metal texture between every texture of the same pool, offset and description (the sharing table g_alias: two NVN objects on the same storage are one texture). With pool 0 and offset 0 every 8x8 RGBA8 of a test was the same texture. t_reorder_chain read the same pixels back from all four of its attachments (independent / dependent copy result 64 of 64 pixels wrong, 30 of 155 checks), t_defer_chain put two attachments of one pass on one texture, which the validation layer refuses (MTL_DEBUG_LAYER=1: "Attachment 0 overlaps with attachment 1", exit 134), and t_mip_extent's MRT case drew its "unwritten" second target into the first. A real texture always has a pool and an offset of its own, so the host is right and the tests were wrong: texture() / tex() / make_tex() now set .off to a different 1 MB step per texture. t_zskip and t_xv pass either way but shared textures the same way, so they got the same line. Checked (GAME=01007EF00011E000): t_reorder_chain 155 checks, 0 failed and t_defer_chain 59 checks, 0 failed under MTL_DEBUG_LAYER=1; t_zskip 38 and t_xv 21 as before; t_mip_extent still fails for two other causes (next commits)
…M_NVN_FUSE_CHECK) redraws the later pass's draws from state snapshots, and since 'AI: THE SOMNIUM FILES' (the per-stage program binding) every such restore takes the program again from the per-stage bindings (nvn_mtl.m prog_resolve: S.prog = bind_stages(NULL, 0)). The test set only S.prog, so the restore found no vertex program, logged "[RED] no program bound before the draw", the redraw drew nothing, and the negative control (a blue merged result against the red plain draw) compared blue with blue: "really compared as different attachments expected 1 -> got 0", 1 of 10 checks. The test now also sets S.bst[0] and S.bst[1], as a BindProgram of both stages does. Host code unchanged: production always binds through bind_stages. Checked: t_fuse_check 10 checks, 0 failed
…mip_extent, the unselected levels read zero). The test seeds each texture with its own Metal clear pass and reads it back on the old queue with [g_q commandBuffer]. Since new-texture zeroing (a new texture's levels are zeroed by an upload batch on the submit thread, which is the test's thread once the first mtl_sub_begin ran) the zeroing was still queued when the seed ran and went out after it, wiping the blue seed of every level the pass under test did not touch (clear_L0 lv1..3 read 0 0 0 0, 12 + 2 + 1 texels). Every command buffer created outside the replay has to come from q_cb, which flushes the pending upload batch and waits for it (the comment above q_cb says so); the test's two command buffers are q_cb now. Until the previous commit separated the textures, the case before it shared one texture, which was already zeroed, and hid this. Checked: with the previous commit, t_mip_extent leaves only the partial clear case (next commit); --stencil-only 24 checks, 0 failed
…tial_clear, was partial_clear_reject). The case recorded ClearColor with scissor (1,1,2,1) on level 1 and expected the level to stay unchanged, from when the host rejected a scissored clear (a load action would clear the whole level). The host has drawn such a clear as a triangle in the scissor rectangle since 'TOTK's 3D scene renders ... in-pass clears' (nvn_mtl.m OP_CLEAR_COLOR: clear_color_tri), which is what NVN does: the clear honours the scissor. The two texels (x 1..2, y 1) read red, the rest of the level and every other level stay blue, 2 of 12 texels differed from the old expectation. colour_check now expects exactly that rectangle red and the case is renamed. Checked: t_mip_extent 303 checks, 0 failed under MTL_DEBUG_LAYER=1, --stencil-only 24, 0 failed
…failed). The test expects the depth-only pass mode (g_enc_mode 4), the merged pass of the attachment range candidate and the DontCare store of the unwritten depth-stencil, which are TBDR optimizations; those have been off unless DM_NVN_TBDR=1 since Mario (bindless textures, nvn_mtl.m tbdr_on), so the first draw opened in mode 0 ("first draw in depth read-only mode expected 4 -> got 0"), the two passes were not merged and the attachment bytes were 2304 instead of the model's. t_zskip and the other TBDR tests already set the variable; t_rt_range does now at the start of main, before mtl_init. Not a host bug: the default is on purpose. Checked under MTL_DEBUG_LAYER=1, 19 cases, 0 failed in each of the five variants of the recipe (DM_NVN_UNWRITTEN_DC=0, default, --disabled, --small-depth, --sample-attachment --both-flags)
…s when the samples are not there. Both read reflection json files of Super Mario Bros. Wonder's translated shaders from the NSP script's build cache (DM_ROOT or ~/dm-work/build/cache/metal_shader_cache/b-<chain>/). t_refl counted every missing file as a failure (2 of 14 checks, "[RED] missing reflection sample") and t_rt_range_ro passed the nil file to NSJSONSerialization, which raises and aborts (exit 134) before it prints its result. Both print "SKIP: no reflection sample <path> ..." for each missing file and go on with the checks that need no sample: t_refl's PC chain rejection, handle array and negative cases, t_rt_range_ro's 14 synthetic binding cases; t_refl's summary line says how many sample files were missing. With the samples present nothing changes. Checked on a Mac without the samples: t_refl 14 checks, 0 failed, 2 sample files missing; t_rt_range_ro 18 cases, 0 failed, exit 0; not checked: the sample checks themselves (no samples here)
v0lumehi
force-pushed
the
fix-gfx-tests
branch
from
October 24, 2026 12:42
5102c3a to
2144db8
Compare
seedds
added a commit
that referenced
this pull request
Oct 24, 2026
… tests only, no host change). Each failure was a test that no longer matched what the host does on purpose: t_reorder_chain, t_defer_chain, t_mip_extent, t_zskip and t_xv made textures with no pool at one offset, which the sharing table (g_alias) made one Metal texture, so two attachments of one pass overlapped and the validation layer aborted; each test texture now has its own storage offset. t_fuse_check set only S.prog, and the redraw takes the program again from the per-stage bindings (prog_resolve). t_mip_extent seeds and reads back through q_cb(), since new-texture zeroing is queued as an upload batch and wiped the seed, and a scissored colour clear is drawn as a triangle (clear_color_tri) that fills exactly its rectangle, which the test now checks instead of expecting nothing. t_rt_range sets DM_NVN_TBDR=1 (the depth-only pass mode and merged passes are off without it). t_refl and t_rt_range_ro print a SKIP line for each missing reflection sample instead of failing or aborting (the samples are not among Super Mario Bros. Wonder 1.2.1's shaders either; t_rt_range_ro still runs its 18 other cases). Checked: make -C dm/gfx/tests GAME=01007EF00011E000 run exits 0 on an M-series Mac
Owner
|
Merged as 46299bb on main, unchanged. With it |
v0lumehi
added a commit
to v0lumehi/nxnative
that referenced
this pull request
Oct 24, 2026
…on GitHub's macOS runners .github/workflows/tests.yml (pull requests, pushes to main, manual runs; read-only token, superseded runs cancelled, logs uploaded on failure only), three parallel jobs on macos-26 (Xcode 26.6, a virtual Mac without Metal 4, so no test that goes through mtl_init runs there): - host unit tests (dm/host/tests) and the CPU-only gfx tests t_dirty_slots, t_dirty_race, t_pace, t_fstep, t_hmap, t_cover, t_pso_skey, t_refl and t_rt_range_ro (the last two skip their sample checks since seedds#118); - every dm/tools, dm/ios and dm/gfx test_*.py file, with lz4, capstone and fonttools from pip (cached); - build check: the Mac host for three profiles (NVN, Vulkan, OpenGL), every gfx test compiled and not run, and the iOS host sources compiled for the iPhone SDK without signing or a project (dm/ios/tools/compile_check.py, which takes the file list and flags from the host Makefile's expanded commands as gen_build.py does). Not in CI: the GPU tests, and profile_guess.py --check, which reads the games' extractions. Actions are pinned to commit SHAs with their tags in comments.
Know-It-All-Brother
pushed a commit
to Know-It-All-Brother/nxnative
that referenced
this pull request
Nov 9, 2026
…ds#118; tests only, no host change). Each failure was a test that no longer matched what the host does on purpose: t_reorder_chain, t_defer_chain, t_mip_extent, t_zskip and t_xv made textures with no pool at one offset, which the sharing table (g_alias) made one Metal texture, so two attachments of one pass overlapped and the validation layer aborted; each test texture now has its own storage offset. t_fuse_check set only S.prog, and the redraw takes the program again from the per-stage bindings (prog_resolve). t_mip_extent seeds and reads back through q_cb(), since new-texture zeroing is queued as an upload batch and wiped the seed, and a scissored colour clear is drawn as a triangle (clear_color_tri) that fills exactly its rectangle, which the test now checks instead of expecting nothing. t_rt_range sets DM_NVN_TBDR=1 (the depth-only pass mode and merged passes are off without it). t_refl and t_rt_range_ro print a SKIP line for each missing reflection sample instead of failing or aborting (the samples are not among Super Mario Bros. Wonder 1.2.1's shaders either; t_rt_range_ro still runs its 18 other cases). Checked: make -C dm/gfx/tests GAME=01007EF00011E000 run exits 0 on an M-series Mac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every graphics test in the
dm/gfx/testsrun list now passes on main (make run GAME=01007EF00011E000exits 0, withMTL_DEBUG_LAYER=1wherever the recipe uses it). Before, t_fuse_check, t_reorder_chain, t_defer_chain, t_mip_extent, t_rt_range and t_rt_range_ro failed, as bc5ba1b's message notes. Only tests changed, no host code: each failure came from a test that no longer matched what the host does on purpose.g_alias) made every 8x8 RGBA8 texture one Metal texture. Two attachments of one pass then overlapped, and the validation layer aborted on that. Each test texture now gets its own storage offset.prog_resolve). The test set onlyS.prog, so the redraw drew nothing and the negative control compared blue with blue.q_cb(). New-texture zeroing is queued as an upload batch, and it wiped the seed. Separately, the test expected a scissored colour clear to do nothing; the host draws it as a triangle (clear_color_tri), so the test now checks that the clear covers its rectangle.DM_NVN_TBDR=1.t_pfv already passes on main since #106.
Checked: the full gfx run list, and the host unit tests (
dm/host/tests), on an M2 Max. The sample-based checks of t_refl were not run, because the samples are not on this machine.🤖 Generated with Claude Code