Repository navigation
Read stored Zarr result pages, load 2D/3D results when shown - #2555
Merged
Merged
Conversation
A result page may now come as a signed link to a Zarr array in object storage instead of inline JSON. storedPages.ts fetches the array's zarr.json and its shard c/0 (without credentials), decodes the float32 values (zstd through fzstd, gzip through DecompressionStream, or raw; chunks left out of the shard read as zeros) and rebuilds the page as the JSON pages had it. A page without a shard (404) reads as zeros. Pages sent inline are used as before, so this works with backends that do not store pages yet. A stored page in any other format is rejected with a clear error: the backend stores pages only as Zarr. Both /results requests (all pages, and pages of one estimator) go through the reader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ9KD58o1ZKVo3JhWp9UzY
An estimator now loads its 0D and 1D pages at once. Its 2D and 3D pages load only when their place in the results scrolls into view (LazyPageGroup, IntersectionObserver), with a Load button where the browser cannot tell. Opening a depth-dose line no longer downloads the maps and volumes next to it. - lazyPages.ts splits an estimator's pages by dimension into eager and lazy groups; getFullSimulationData and EstimatorsSelect fetch only the eager ones. - An estimator of 2D maps only still gets its tab, with no pages until shown. - A group that fails to load gets its Load button back. CacheMap now rejects a failed fetch and drops the entry instead of leaving every caller waiting forever, so the retry fetches again. - Pages loaded for one simulation are never written into another one shown meanwhile. - Geant4 results computed in the browser are shown whole, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ9KD58o1ZKVo3JhWp9UzY
…2527) A group whose request failed while its place was in view was asked for again and again (about 4 requests a second): the group objects are built anew on every render, so LazyPageGroup observed its place again each time, and a new observer reports a place in view at once. - LazyPageGroup is observed again only when its pages change, and not while it loads or after a failed load. - A failed group says so and shows the Load button; only the button tries again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ9KD58o1ZKVo3JhWp9UzY
…d again (#2527) getFullSimulationData merged the pages of each dimension group into the first group's estimator object, which is also the cached result of that request. Each time a simulation was opened again its cached pages grew, so its tab showed the same plots several times and "Save to file" wrote a page up to 16 times. The merge now works on a copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJ9KD58o1ZKVo3JhWp9UzY
…link (#2527) ky gives up on a request after 10 s by default. A group of 2D or 3D pages can take megabytes (1.6 MB for two 40x40x100 volumes), so on a slow link (about 400 kbit/s) it never loaded and only failed with the Load button. The result requests now wait as long as the server answers, as the stored pages' links already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #2527
The UI side of storing result pages in object storage. It has no dependencies. It must be deployed before the backend's bucket is turned on. With today's backend, which sends every page inline, it changes only how 2D/3D pages load.
Docs: yaptide/for_developers#114 (results loading)
Changes
format: "zarr-v3",zarr.jsonand the shardc/0) instead of inline JSON.storedPages.tsdecodes the float32 values (zstd throughfzstd, gzip throughDecompressionStream, or raw; left-out chunks and a missing shard read as zeros) and rebuilds the page as the JSON pages had it.LazyPageGroup), with one request per group.CacheMapnow rejects a failed fetch and drops the entry, so a retry fetches again./results. ky's 10 s default stopped a 1.6 MB 3D group on a slow link.Tests
storedPages.test.ts(with thezarrPages.jsonfixture, written by the backend'sresult_format.py),lazyPages.test.ts,LazyPageGroup.test.tsx,CacheMap.test.ts,__tests__/RemoteWorkerSimulationService.test.ts. All 45 tests insrc/services,src/utilandResultspass.Browser tests on yap-dev
Playwright (Chromium) against this branch, deployed on yap-dev with the current backend. 9 simulations: direct and batch, SHIELD-HIT12A and FLUKA, Jan–Nov 2026, one of them with 0D–3D pages.
/results(165 pages)zarr.json403 shows the error and the Load button; inline and stored pages mixed in one estimatorThe app already needs
IntersectionObserver: the JSROOT canvas (react-hook-visible) creates one without checking, so without it a results page goes blank. That isn't changed here.A performance pilot (5 runs each) showed no measurable difference against master, because none of the test simulations has an estimator that mixes lines with maps. The gain is for such estimators, whose maps below the lines load only when scrolled to.
Generated by Claude Code