[BUG] MRXS reads are not deterministic: overlapping camera tiles are painted from parallel tasks

Open
#96 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

@AzHicham is already working on this.

Since Oct 16, 2026.

  • #97 by @AzHicham — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp

Research direction

Start with MrxsTileExecutor::ExecutePlan and the canvas coverage logic in rgb_blit.cpp and bilinear_blit_hwy.cpp; compare the existing BifTileExecutor handling of overlapping tiles. Reproduce with the named MRXS test slide and repeat read_region calls. Done means overlapping tile reads return identical pixels across runs while retaining parallel decoding; an open linked pull request indicates work is already underway.

Written by the indexing model from the issue text.

Description

Problem

MRXS reads are not deterministic: the same read_region returns different pixels from one call to the next, even from a single thread.

Reading one 512×512 region at level 4 of a MRXS slide (Mirax2.2-4-BMP.mrxs, OpenSlide test data) 20 times in a row, without a cache:

  • 19 of 19 repeat reads differ from the first;
  • up to 29 220 of 262 144 pixels differ (11 %), by up to 140 levels (histogram from 1 to 140, so whole overlap bands switch between camera tiles, not rounding).

On a tile-by-tile scan of the slide (973 tiles at ~4 mpp and ~0.5 mpp), 145 tiles change between two runs.

Cause

MRXS camera tiles overlap. MrxsTileExecutor::ExecutePlan paints the operations of a read from parallel pool tasks (submit_sequence over plan.operations). The canvas resolves overlaps with its coverage map, first writer wins (rgb_blit.cpp, bilinear_blit_hwy.cpp skip already-covered pixels). The first writer is whichever task finishes decoding first, so the visible camera tile in an overlap changes from read to read.

Running the operations serially on one thread makes the output deterministic: 0 of 973 tiles change between runs, and 0 of 19 repeat reads differ.

Proposal

Do what BifTileExecutor already does for its overlapping tiles: decode the tiles of a read in parallel (phase 1), then paint them serially in a fixed order (phase 2), e.g. plan order, or the order that matches OpenSlide's MRXS rendering. That keeps the parallel decode and makes the output a function of the request only.

Dominant language
C++
Stars
56
Forks
4
Avg merge
5d 3h
Merged PRs (30d)
7

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NKI-AI/fastslide

All issues in NKI-AI/fastslide

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.