Skip to content

CI ratchets after the 0.12.0 upstream merge (clang-tidy, host warnings) - #36

Merged
gnosticgeek merged 2 commits into
mainfrom
fix/clang-tidy-0.12.0
Nov 6, 2026
Merged

gnosticgeek merged 2 commits into
mainfrom
fix/clang-tidy-0.12.0

Conversation

@gnosticgeek

@gnosticgeek gnosticgeek commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

What and why

Two CI ratchets went red on the 0.12.0 release PR (#35) after the upstream merge: clang-tidy (lint-c) and the Mac host compiler-warnings check in Build check. The release shipped without these fixes, so main is red on both until this PR lands.

f983a79: clang-tidy. The LLVM 23.1.4 analyzer flags code that landed with the upstream merge.

  • dm/gfx/nvn/nvn_mtl.m: a NOLINT, with the reason on the same line, on eight analyzer false positives:
    • BitwiseShift: the shift is by __builtin_ctz of a nonzero word.
    • ArrayBound (five cases): each index is bounded by the line before it (addressed ranges, vertex streams, g_mrb, g_mrbuf).
    • RetainCount (two cases): the objects are held by hm_put_id maps.
  • t_depth16_clear, t_dlss_mfx, t_ndve_movie, t_pool_heap, t_upscaler_mfx: a NOLINT for StackAddressEscape on g_tex_live. mtl_tex_release reads the stored address through vm_read_overwrite and checks magic and serial, so a helper that returns its tex_t by value is safe.
  • t_feedback: a NOLINT for bugprone-signed-char-misuse. The bf_key offsets are int8_t on purpose (-1 = none).
  • t_pso_stall: a real fix. An archive that doesn't open is now left out instead of being added as nil.
  • dm/tools/lint_c_baseline.tsv: regenerated with tidy --update. 11 file/check pairs now have fewer findings, and t_view_swizzle is back below main's count.

d27661c: host warnings. mtl_tex_init passed its const tex_t * to nvn_hm_put's void * value, which is a new -Wincompatible-pointer-types-discards-qualifiers warning (upstream stores (void *)1 at that point). The map only reads the address back, in mtl_tex_release as a const tex_t *, so an explicit cast is safe.

Checked

  • clang-tidy ratchet: green in CI on f983a79. Before that it was run on an Apple silicon Mac the way CI runs it: LLVM 23.1.4, --against origin/main, rc 0, 220 findings against a baseline of 220 (down from 237), and 0 pairs above the baseline.
  • Host warnings: the failing Build check on f983a79 (and on the release head 1550f95) reported exactly one new warning and 0 fixed-but-listed. That warning is at nvn_mtl.m:2373, which d27661c changes. A minimal clang repro gives the same warning without the cast and none with it. The rerun on d27661c is pending.
  • Gfx tests for the touched files pass with GAME=0400486024DEC000:
    • depth16_clear, ndve_movie, pool_heap: pass.
    • dlss_mfx: 7 passed, 0 failed.
    • pso_stall: 41 passed, 0 failed.
    • upscaler_mfx: 12 passed, 0 failed.
    • view_swizzle: 554 passed, 0 failed.
    • feedback: 193 passed, 0 failed.
  • t_feedback failed 1 of 193 on an earlier run where only a comment had changed, so it looks flaky. That failure isn't related to this change.
  • No game was run. Apart from the t_pso_stall guard and the cast, the changes are comments and the baseline.

Docs

  • No game files, keys or data extracted from a game in the change

🤖 Generated with Claude Code

https://claude.ai/code/session_016qteK29T18U8p1c9LsVY8g

…two nil archives guarded in t_pso_stall, baseline 237 -> 220

- nvn_mtl.m: NOLINT with the reason on eight analyzer findings in landed code: a shift by __builtin_ctz of a nonzero word, indices bounded by the line before (addressed ranges, vertex streams, g_mrb, g_mrbuf), and two objects held by hm_put_id maps
- t_depth16_clear, t_dlss_mfx, t_ndve_movie, t_pool_heap, t_upscaler_mfx: g_tex_live keeps the address a texture was initialized at; mtl_tex_release reads it through vm_read_overwrite and checks magic and serial, so a helper returning its tex_t by value is safe (NOLINT StackAddressEscape)
- t_feedback: the bf_key offsets are int8_t on purpose (-1 = none)
- t_pso_stall: an archive that does not open is left out instead of added as nil
- lint_c_baseline.tsv: tidy --update (11 file/check pairs had fewer findings; t_view_swizzle back below main's)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qteK29T18U8p1c9LsVY8g
@github-actions github-actions Bot added nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts) labels Nov 6, 2026
…t (host warnings ratchet)

mtl_tex_init passed its const tex_t * to nvn_hm_put's void * value, a new
-Wincompatible-pointer-types-discards-qualifiers warning from the 0.12.0
upstream merge (upstream stores (void *)1 there). The map only reads the
address back (mtl_tex_release, as a const tex_t *), so the cast is safe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qteK29T18U8p1c9LsVY8g
@gnosticgeek gnosticgeek changed the title clang-tidy ratchet after the 0.12.0 upstream merge CI ratchets after the 0.12.0 upstream merge (clang-tidy, host warnings) Nov 6, 2026
@gnosticgeek
gnosticgeek merged commit c2221c9 into main Nov 6, 2026
9 checks passed
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) tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants