Skip to content

ci: pin ratchet comparisons and make Metal fixture lifetimes explicit - #1060

Closed
ComicBit wants to merge 7 commits into
seedds:mainfrom
ComicBit:ci-pin-ratchet-base
Closed

ComicBit wants to merge 7 commits into
seedds:mainfrom
ComicBit:ci-pin-ratchet-base

Conversation

@ComicBit

@ComicBit ComicBit commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Current revision

fbb2c2b665b4a70bcb5ff28a92cdd89e11409b42, rebased onto upstream e20888b4c42518f2874905a0c19498526a90d37c.

Registry-test cleanup and upstream overlap

PR813 Tool tests failed because an uppercase-namespace assertion misclassified upstream Animal Crossing constants/instruction helpers as patch tables. Removed that implementation-only assertion rather than adding an allowlist of helper names. Validation of the actual CUTS, OBS, FRAME_STEP, CAPABILITIES and binding metadata remains intact; the module/helper contract is documented.

Those registry commits alone change only tests and development documentation. The subsequent e208 upstream rebase and its current verification are described below. Registry, documentation and full Python checks now pass locally. All eight required exact-head GitHub checks pass for fbb2c2b6, including both lint ratchets, sanitizers and unsigned iOS compilation. Upstream 8f8b9d5a separately fixes the immediate Animal Crossing failure by lowercasing its helpers; removing the namespace assertion here is a general test-contract cleanup, not an additional runtime fix or a necessary fix for latest main. The older green checks are not relabeled as checks of this cleanup.

Problem 1: queue-time baseline race

Lint ratchets compared a checked-out PR merge snapshot with a fresh fetch of the moving base branch. If main shrinks a baseline while a job is queued, an older snapshot is falsely reported as growing it.

Observed in PR923's full scan: LLVM 23.1.4 found 271 findings, exactly matching the snapshot baseline, with 0 pairs above and 0 below. Comparison then failed on crash.c bugprone-command-processor 0 -> 1 after newer main removed the entry. This was not a new finding introduced by that PR.

Both lint workflows now fetch github.event.pull_request.base.sha through a quoted environment variable. The unchanged --against FETCH_HEAD compares against the immutable event base. Push/manual behavior is unchanged.

Metal fixture ownership and presentation contract

The newer program-finalization/image-feedback fixtures exposed opaque CF-map ownership to the analyzer. Keep explicit ARC owners until the GPU and deferred view retirement finish, unregister fixture bindings, remove serial registrations and release the owners. The image case also verifies residency retirement. No production ownership leak is claimed from the analyzer diagnostic alone.

The presentation path already requires a texture descriptor: its callers and implementation dereference it. Document that existing contract and remove contradictory optional-descriptor branches. Do not add a NULL no-op or change valid-call behavior.

Upstream #1141 has already removed main's stale RetainCount allowances; those reductions are not credited again here. The current branch's only remaining baseline reduction is:

File/check Current upstream Observed with contract repair
nvn_mtl.m / NullDereference 9 8

No allowance, suppression or tool-version change is added.

Upstream overlap

The earlier TXQ optional-match guard is now upstream as 379e885e; its local duplicate has been dropped. Preserve upstream read-only image feedback, CPU-written 3D upload and streamed shader-package reading.

Current verification

Production integration 93ff097b passes generated indexes, documentation tests, full Python ratchets, queue-origin and image-alias GPU consumers in both encoding modes, and four normal-producer feedback configurations (169 checks each). The complete 226-unit LLVM 23.1.4 scan observes 261 findings and zero new/stale baseline pairs against e20888b4. Final commit fbb2c2b6 only records the measured 262-to-261 baseline shrink; compiled inputs are unchanged.

All eight required exact-head GitHub checks pass for fbb2c2b6; this is the current-head result, not relabeled earlier checks. No new game shader build, benchmark, phone deployment or runtime performance gain is claimed.

Review order

The code feature PRs temporarily carry these independent CI/fixture/descriptor commits. Landing this PR first will simplify their diffs and remove the shared baseline dependency. The documentation-only #805 is now decoupled and carries none of these runtime/CI changes.

@github-actions github-actions Bot added docs Documentation ci Continuous integration and repository settings (.github) labels Nov 3, 2026
@github-actions github-actions Bot added the tools Tools and scripts (dm/tools, scripts) label Nov 3, 2026
@ComicBit ComicBit changed the title ci: pin lint baseline comparisons to the PR event base ci: pin lint baseline comparisons and guard TXQ fixture lookup Nov 3, 2026
@ComicBit
ComicBit force-pushed the ci-pin-ratchet-base branch from 09a7702 to 724dcd8 Compare November 3, 2026 11:03
@github-actions github-actions Bot added the nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) label Nov 3, 2026
@ComicBit
ComicBit force-pushed the ci-pin-ratchet-base branch from 724dcd8 to 3255e66 Compare November 3, 2026 11:27
@ComicBit ComicBit changed the title ci: pin lint baseline comparisons and guard TXQ fixture lookup ci: pin ratchet comparisons and make Metal fixture lifetimes explicit Nov 3, 2026
@ComicBit
ComicBit force-pushed the ci-pin-ratchet-base branch from 3255e66 to cf4d8d2 Compare November 3, 2026 11:55
The focused LLVM 23.1.4 report attributes an opaque serial-table CF retain to original in image_view_case. Complement that registry ownership with an explicit ARC fixture owner, as in t_queue_origin, without changing production ownership or suppressing the finding.

Keep both serial-table assertions and image view coverage. Verify cached views retire, unbind the fixture descriptor and attachment state, complete the next fence used by deferred retirement, drain releases, and require the base texture to leave residency before dropping the ARC owner. Pixel expectations and production feedback behavior are unchanged. Focused lint and GPU verification are reserved to the parent exclusive runner.
@ComicBit
ComicBit force-pushed the ci-pin-ratchet-base branch from 14c4afd to fbb2c2b Compare November 3, 2026 23:41
@seedds

seedds commented Nov 29, 2026

Copy link
Copy Markdown
Owner

Thank you @ComicBit for tracking down the queue-time lint baseline race and documenting the PR #923 failure.

The CI ratchet fix landed on main in 3e0d89d (with co-author credit): both lint-c.yml and lint-python.yml now check out with fetch-depth: 2 and compare against HEAD^1 (the exact base parent of the pull request merge commit, matching tests.yml's coverage job) instead of fetching the moving main branch tip, and docs/development.md notes the behavior.

Checked with the lint and docs unit tests (test_lint_c.py, test_lint_python.py, test_docs.py), YAML validation, and a depth-2 merge-commit test where main shrinks both baselines after the PR merge commit is created.

The other changes bundled in this PR were left out because they are already superseded on main (present_enqueue's redundant null checks were removed in d8b2b64, and the analyzer retain-count false positives for hash-map ownership were resolved via CF_CONSUMED in be23843) or weaken test_patches.py's check for unread uppercase patch tables (which 8f8b9d5 kept by lowercasing Animal Crossing's private helpers). Nothing further is open for this change.

@seedds seedds closed this Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration and repository settings (.github) docs Documentation 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