Update the animator contour match test for matched image tiles - #90
Merged
Conversation
Within one animation frame the backend serves the reference image and then each matched image, and the test sends ADD_REQUIRED_TILES as soon as the reference image tile arrives, so the message can still take effect on the matched image of that same frame. The milestone channel was therefore ambiguous, and the macOS CI runner won the race the Linux runners lose. Check the three channels before each milestone instead of ending on it, and move the milestones to 4, 10, 16 and 22 to keep the checked channels at 1 to 3, 7 to 9, 13 to 15 and 19 to 21.
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.
Description
Closes #24. Updates
ANIMATOR_CONTOUR_MATCHfor backend PR CARTAvis/carta-backend #1270, which started sending raster tiles of spectrally matched images during animation.The test previously watched only the reference image: it awaited one tile group per frame and asserted contours for both files. It passed for the wrong reason: the matched image was never tiled, because nothing in the test ever gave it animation view settings.
Session::ExecuteAnimationFrameInner(Session.cc:2214-2278) now walks every file inmatched_frameson each animation frame, advances itsz, and sends contours, vector field, tiledata and region data for each. The tile request comes from that file's stored
GetAnimationViewSettings().How a matched image acquires those settings is the non-obvious part.
OnMessageTask.tcc:18dispatchesADD_REQUIRED_TILESwithskip_data = AnimationRunning(), andOnAddRequiredTilesstores the message as animation view settings only on that path:tilesSo a matched image opened before
START_ANIMATIONis not tiled at all until the frontend sends a tile request for it while the animation runs, and an empty tile list, which is what AppStore.ts:2056-2062 pushes when a matched image is no longer visible, stops its tiles again without stopping its channel updates.What the test pins
One continuous playback through four states, three channels checked in each:
Channels 1-3, before any tile request for the matched image: only the reference image is tiled, and no
RASTER_TILE_SYNCarrives for the matched one.Channels 7-9, after
ADD_REQUIRED_TILESfor the matched image, sent mid-animation on channel 4: both images get oneRASTER_TILE_DATAand a complete start/end sync pair per channel.Channels 13-15, after
ADD_REQUIRED_TILESwith an empty tile list on channel 10: only the reference image again.Channels 19-21, after the tile request is repeated on channel 16: both images again.
Across every checked channel of every phase, both images return their contours (at
progress = 1, withreference_file_id = 1) and one histogram. That is the discriminating check: the matched image keeps stepping through its own channels while it is not tiled, so an empty tile list suppresses only raster data.Two structural changes
The per-frame stream loop had to go.
Stream(CARTA.RasterTileData, n)takes two messages offrasterSyncStreamandn-2offrasterTileStream, resolving on the end sync. It assumes a single sync group, and there are two per frame once the matched image is tiled. The old subscribe/await/ack loop was also problematic: the RxJS subjects do not buffer, and the backend runs a frame ahead, so messages of the frame in flight could be dropped. The test now subscribes once to all four streams for the whole playback and acknowledges flow control from the reference image's tile, which is what paces the animation.Tiles are asserted per
file_id, not by arrival order._matched_framesis anunordered_map, so the order in which the two images are served within a frame is not part of the interface.Phases are spaced 6 channels apart with a 3-channel window asserted. The backend runs at most one frame ahead of the last flow-control ack, and a client message queued mid-frame lands a frame or two later, so the unchecked channels around each message are a settling band worth ~600 ms.
The channel a message is sent on is not asserted. Within a frame, the backend serves the reference image, and then each matched image, and the test sends its message as soon as the reference image tile arrives. So the message races the remaining half of that frame and may or may not take effect on it.
milestone - 1is the last channel whose matched image was already on the wire when the message went out, so the window ends there. This is race-free by construction rather than by timing margin, which matters because the two sides of that race resolve differently per platform: the first draft asserted the milestone channel itself and passed on every Linux runner while failing all three view-setting milestones on macOS.Changes
src/test/ANIMATOR_CONTOUR_MATCH.test.tsdocs/source/animator.rstNo stage-file change:
ICD_test_stages/animator.testsalready lists the test. Fixtures (M17_SWex.fits,M17_SWex.image) are unchanged and already inset_QA.Also fixes a latent fixture bug:
setImageChannel[1]hadfileId: 1butrequiredTiles.fileId: 0, so the post-animation tile request was aimed at the wrong image.Checklist
For the pull request:
(or no documentation changes are needed)