Repository navigation
test(rp2350): assert PIO0+PIO1 resource behaviour at the SDK-claim level (#3899) - #4215
Merged
zackees merged 1 commit intoSep 8, 2026
Conversation
…vel (#3899) #3899 requires PIO0 + PIO1 simultaneous execution to pass "without resource collision, stale state machine, or DMA ownership leak". runParallelTest drives both blocks but for this exact pair it skips RX validation and asserts nothing about resources, so its PASS proves only that show() returned. All three named failure modes are invisible to it. I previously cited that PASS as evidence for this criterion; it isn't. testRpPioParallelResources queries the SDK claim system directly (pio_sm_is_claimed / dma_channel_is_claimed), which is ground truth regardless of how the engine is implemented. ChannelEngineRpPio claims per transmission and deinitializes when the transfer drains, so the sample is taken between show() and wait() -- sampling after the wait sees an idle engine and proves nothing. Verified on RP2350W 2DCB876B587EA334, 256 LEDs x 8 frames: noResidueBetweenFrames=True no state machine kept across a frame noLeak=True baseline restored after teardown noOverClaim=True never >1 SM per block, never >2 DMA observedInFlight=True probe actually caught a live transfer Simultaneity is deliberately NOT asserted. show() drains the frame before returning on this path, so the in-flight window yields ~1 sample per frame (samplesTaken=12 over 8 frames) -- too coarse to separate genuine serialization from an unlucky sample. pio0HeldOne, pio1HeldOne and bothHeldAtOnce are reported as diagnostics for that open question and do not gate success. Asserting either direction on this evidence would be unfounded. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01KkufoNxfnNRU9psT3R9F51
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
12 tasks
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.
Stacked on #4214 (shares the AutoResearch RPC registration files). Review that one first.
The gap
#3899 requires:
runParallelTestdrives both blocks at once, but for this exact pair it skips RX validation and asserts nothing about resources (AutoResearchRemoteRunParallelTest.cpp:308). Its PASS proves only thatshow()returned. All three named failure modes are invisible to it.I previously cited that PASS as evidence for this criterion on #3899. It is not, and this replaces it with a measurement.
Approach
Query the SDK claim system directly —
pio_sm_is_claimed,dma_channel_is_claimed— which is ground truth independent of the engine implementation.The sample window matters.
ChannelEngineRpPioclaims per transmission and callsdeinitialize()when the transfer drains, so resources are held only while a frame is in flight. Sampling afterFastLED.wait()sees an idle engine and proves nothing — my first draft did exactly that and reported zero resources claimed, which looked alarming and was purely a measurement error.Verified on RP2350W
2DCB876B587EA334(256 LEDs × 8 frames)noResidueBetweenFramesnoLeaknoOverClaimobservedInFlightWhat is deliberately not asserted
Whether PIO0 and PIO1 are ever claimed at the same instant.
FastLED.show()drains the frame before returning on this path, so the observable in-flight window yields roughly one sample per frame —samplesTaken: 12across 8 frames, even sampling in 1 ms slices. That is too coarse to separate genuine serialization from an unlucky sample.Observed:
pio1HeldOne: True,pio0HeldOne: False,bothHeldAtOnce: False. That is consistent with serialization but does not establish it, sopio0HeldOne/pio1HeldOne/bothHeldAtOnceare reported as diagnostics and do not gatesuccess. Asserting either direction on this evidence would repeat the mistake this PR exists to correct.Settling it needs either an async show path that leaves both engines in flight, or instrumentation inside the engine. Worth a follow-up; flagging rather than guessing.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KkufoNxfnNRU9psT3R9F51