Skip to content

Add ICD coverage for channel and stokes changes on an inactive file - #89

Merged
markccchiang merged 2 commits into
devfrom
mark/tile-data-inactive-file
Aug 9, 2026
Merged

Add ICD coverage for channel and stokes changes on an inactive file#89
markccchiang merged 2 commits into
devfrom
mark/tile-data-inactive-file

Conversation

@markccchiang

@markccchiang markccchiang commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Description

Closes #31. Adds ICD coverage for SET_IMAGE_CHANNELS sent 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:

frame frontend call message
visible TileService.requestTiles(...) SET_IMAGE_CHANNELS with a full required_tiles
not visible TileService.updateHiddenFileChannels()setChannels(fileId, ch, st, {}) SET_IMAGE_CHANNELS with an empty required_tiles

The empty required_tiles shape was untested. ANIMATOR_NAVIGATION already 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::OnSetImageChannels sets channel/stokes, runs UpdateImageData, then only forwards to OnAddRequiredTiles if (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.

  1. Empty-tiles update on file 1 -> REGION_HISTOGRAM_DATA at the new channel/stokes, and no RASTER_TILE_SYNC or RASTER_TILE_DATA at all.

  2. File 0 re-reads tiles -> still at its own channel 0 / stokes 0, unaffected.

  3. File 1 re-reads tiles -> serves at channel 2 / stokes 1. No further SET_IMAGE_CHANNELS was sent after step 1, so that position can only have come from the empty update.

  4. Both files updated back to back without waiting -> two complete, correctly tagged tile groups.

Step 4 asserts per file_id rather 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

File
src/test/TILE_DATA_INACTIVE_FILE.test.ts new - 27 tests
ICD_test_stages/raster_tiles.tests register the test in the raster-tiles stage
docs/source/tile_data_request.rst document the 10 steps and Checks 1-6

Fixtures are M17_SWex.hdf5 (active) and HH211_IQU.hdf5 (inactive). HH211_IQU carries a spectral and a Stokes axis, so channel and stokes can be changed together.

Two local helpers

Stream(CARTA.RasterTileData, n) takes two messages off rasterSyncStream and n-2 off rasterTileStream, 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:

  • Documentation has been updated (or no documentation changes are needed)

@markccchiang
markccchiang marked this pull request as ready for review August 5, 2026 15:58

@loveluthien loveluthien left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

@markccchiang
markccchiang merged commit fb8fd80 into dev Aug 9, 2026
113 checks passed
@markccchiang
markccchiang deleted the mark/tile-data-inactive-file branch August 13, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add one more test to tile-related ICD-RxJS

2 participants