Skip to content

Tests check the Metal device, textures, encoders and functions they make before using them - #1338

Closed
oliverames wants to merge 1 commit into
seedds:mainfrom
oliverames:fix/int-float-view-nil-checks
Closed

oliverames wants to merge 1 commit into
seedds:mainfrom
oliverames:fix/int-float-view-nil-checks

Conversation

@oliverames

Copy link
Copy Markdown
Contributor

What

clang-tidy's nullability check (`clang-analyzer-nullability.NullablePassedToNonnull`) flags `dm/gfx/tests/t_int_float_view.m`, which f083873 introduced. The test passes unchecked results of `MTLCreateSystemDefaultDevice`, `newTextureWithDescriptor`, `newTextureViewWithPixelFormat`, the command queue, buffer, encoder and shader-function calls into later calls. The ratchet then fails lint-c on main, and every PR that touches `dm/host` or `dm/gfx` inherits the failure.

This adds the same kind of nil checks that ad7af9c added to the other Metal tests. Each check prints a message and returns 1. The test's checks and expected values are unchanged.

Verification

  • `python3 dm/tools/lint_c.py tidy` (LLVM 23.1.5 locally): `t_int_float_view.m: 0 findings`, `baseline 240 findings; 0 file/check pairs above it, 0 below it`. The baseline file is not changed.
  • Not run: the test itself on a Metal device or this Mac's GPU, and the full host suite.

…ake before using them

clang-tidy's nullability check flags t_int_float_view.m (introduced by f083873): it passes unchecked results of MTLCreateSystemDefaultDevice, newTextureWithDescriptor, newTextureViewWithPixelFormat and the command and encoder calls into later calls, so lint-c fails on main. Same fix as ad7af9c for the other Metal tests. No change to what the test checks.
@github-actions github-actions Bot added the nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) label Nov 5, 2026
@oliverames oliverames mentioned this pull request Nov 5, 2026
1 of 3 tasks
@oliverames

Copy link
Copy Markdown
Contributor Author

Both this and the three pyright findings on main's own head block the rest of the open-PR fleet's checks: my rebases tonight re-ran them against 865cc35 and every run that touches dm/host or dm/gfx now fails lint-c on the t_int_float_view finding alone (I confirmed on #656, #645, #642, #634, #590, #565, #1140, #1158, #1160, #1178, #1104 and #1167 after their rebases). Merging this and #1374 makes their next run green without another push. Nothing additional from me blocked; #1207 was closed as superseded by f8a5618, and #1102, #1167, #1168 were rebased to hold only what is left of them.

seedds added a commit that referenced this pull request Nov 6, 2026
…ake before using them: lint-c's ratchet passes again (t_int_float_view.m's nullability finding from f083873) (PR #1338)

clang-tidy's clang-analyzer-nullability.NullablePassedToNonnull flagged t_int_float_view.m: it passed unchecked results of MTLCreateSystemDefaultDevice, newTextureWithDescriptor, newTextureViewWithPixelFormat, newFunctionWithName and the encoder calls into later calls. Each is now checked, printing a message and returning 1, as ad7af9c did for the other Metal tests. What the test checks is unchanged.

Co-authored-by: Oliver Ames <7366664+oliverames@users.noreply.github.com>
@seedds

seedds commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Landed unchanged as 671c68e (credited as co-author). Checked here: lint_c.py tidy on the file gives 0 findings, 0 pairs above the baseline; check_t_int_float_view passes on an M4 Pro, all eight words come through compute and fragment unchanged. Thanks.

@seedds seedds closed this Nov 6, 2026
Know-It-All-Brother pushed a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 9, 2026
…ake before using them: lint-c's ratchet passes again (t_int_float_view.m's nullability finding from 0f50468) (PR seedds#1338)

clang-tidy's clang-analyzer-nullability.NullablePassedToNonnull flagged t_int_float_view.m: it passed unchecked results of MTLCreateSystemDefaultDevice, newTextureWithDescriptor, newTextureViewWithPixelFormat, newFunctionWithName and the encoder calls into later calls. Each is now checked, printing a message and returning 1, as 68dfbed did for the other Metal tests. What the test checks is unchanged.

Co-authored-by: Oliver Ames <7366664+oliverames@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants