Repository navigation
Follow up the Metal seams review: pin the handler lifetime and tidy the minors - #43
Merged
Merged
Conversation
…hat cannot pass without the fix
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.
Summary
Follow-ups from the review of #41. The destroy-in-flight guard was never seen red and could not fail in CI; it is now pinned at the
MetalFrameComputelevel, with the minor review items alongside.Also in this PR:
markFailed()is removed; its two test callers store throughfailureLatch().fallback.tileSize,fallback.lodErrorPixelsand the LOD threshold default are named;toCppPolicyuses theSortKeyBitsvalues instead of 16 and 32.MetalSurface.handMetalFrameSlots.hcomments keep only what the code cannot show; the render handler's capture states that the semaphore signal is its last action.ACameraRequestRoundTripsThroughTheStateMirroris removed: it copied the fields by hand and exercised no production code.Behaviour does not change.
Evidence
Before: with the handlers' report capture reverted locally to a raw pointer (the pre-fix shape), never committed, the new test fails without AddressSanitizer:
After: with the fix restored it passes, and the full suite passes:
GpuReportowns the frame loop's failure latch and the handlers capture only the report, so the latch count reaches 2 only while a handler owns the report.The assertion is on ownership, checked before any handler runs, so it is deterministic, and
>= 2does not assume how many copies of a handler block Metal keeps.It does not observe a use-after-free itself; it fails when no handler owns the report, which is the property the fix adds.
Where it ran: Apple GPU on a Mac with the Metal test executable. No physical device and no simulator; no device is attached and none was run.
Checks:
61ea372e20f1cd4f65eeb83e1a8da7f6327e9261.scripts/lint-cpp.sh: clean.scripts/build-ios.shandscripts/package-ios.sh: exit 0.sdk_harness.py,npm run check(nothing they cover changed).M8: no existing test pinned that the prepare shader stops at
kDrawBatchesrecords; the visibility tests only read the firstkDrawBatches. The new test fills extra records with a sentinel and asserts they are untouched.Merge Danger
Door: two-way
Tests, comments, named constants and one removed unused method. Every change reverts with a plain revert.
Blast Radius: tests
The only non-test code changes name existing values (
toCppPolicyaccepts the same 16 and 32) and deleteMetalFrameLoop::markFailed(), which had no callers outside tests.