Add ICD coverage for channel and stokes changes on an inactive file - #89
Merged
Conversation
markccchiang
marked this pull request as ready for review
August 5, 2026 15:58
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 #31. Adds ICD coverage for
SET_IMAGE_CHANNELSsent against an image the user is not currently working on, the protocol behaviour behind carta-frontend #2206.That PR made the frontend update the channel and the stokes of every frame rather than only the active one, and it sends a different message shape depending on whether the frame is being rendered:
TileService.requestTiles(...)SET_IMAGE_CHANNELSwith a fullrequired_tilesTileService.updateHiddenFileChannels()→setChannels(fileId, ch, st, {})SET_IMAGE_CHANNELSwith an emptyrequired_tilesThe empty
required_tilesshape was untested.ANIMATOR_NAVIGATIONalready covers two files changing channel and stokes with tiles, so the genuine gaps were: the empty message, the back-to-back pair, and per-file state isolation.What the test pins
Session::OnSetImageChannelssets channel/stokes, runsUpdateImageData, then only forwards toOnAddRequiredTilesif (message.has_required_tiles()), which itself early-returns on an empty tile list. So the contract for a hidden frame is: histogram yes, tiles no, and the state still moves.Empty-tiles update on file 1 ->
REGION_HISTOGRAM_DATAat the new channel/stokes, and noRASTER_TILE_SYNCorRASTER_TILE_DATAat all.File 0 re-reads tiles -> still at its own channel 0 / stokes 0, unaffected.
File 1 re-reads tiles -> serves at channel 2 / stokes 1. No further
SET_IMAGE_CHANNELSwas sent after step 1, so that position can only have come from the empty update.Both files updated back to back without waiting -> two complete, correctly tagged tile groups.
Step 4 asserts per
file_idrather than by order of arrival. The backend currently serialises the two handlers under_frame_mutex, but that is an implementation detail, not the interface.Changes
src/test/TILE_DATA_INACTIVE_FILE.test.tsICD_test_stages/raster_tiles.testsdocs/source/tile_data_request.rstFixtures are
M17_SWex.hdf5(active) andHH211_IQU.hdf5(inactive).HH211_IQUcarries a spectral and a Stokes axis, so channel and stokes can be changed together.Two local helpers
Stream(CARTA.RasterTileData, n)takes two messages offrasterSyncStreamandn-2offrasterTileStream, resolving on the end sync. That assumes a single sync group, and it hangs rather than fails when nothing arrives, so it can express neither of the two things this test needs:RasterStream(syncCount, tileCount)counts the two subjects separately, so it spans the two sync groups produced by step 4.RasterSilence(durationMs)collects whatever arrives in a fixed window and resolves regardless, which is what makes the negative assertion in step 1 expressible.Checklist
For the pull request:
(or no documentation changes are needed)