Skip to content

Map packed input into edge chunks with scatter lookup tables - #295

Merged
nclack merged 4 commits into
mainfrom
fix/packed-edge-input
Oct 4, 2026
Merged

nclack merged 4 commits into
mainfrom
fix/packed-edge-input

Conversation

@nclack

@nclack nclack commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Packed 9×13 frames were indexed as padded 16×16 frames, corrupting pixels and publishing one frame after three appends. Epoch boundaries, input limits, and final shapes now count logical elements; chunk edges and final LOD tails remain zero.

Single-level edge chunks use precomputed 64-bit row/column offsets through the same lookup scatter as LOD. The mapping handles padding without an extra frame buffer. CPU scatter caches contiguous column spans and joined rows once per array, then copies them in bulk; short runs retain typed scatter. CPU memory estimates include a conservative allowance for cached boundaries. Chunk-aligned input retains the existing transpose path.

Image replay submits packed frames; report readers still accept archived caller-padded results.

Validation: 57 CPU CTest checks including independent Zarr readback, six focused CPU/CUDA checks in the CUDA build, and three ASan/UBSan checks. Regressions cover split appends, worker boundaries, row padding, ragged multidimensional spans, storage permutations, rank-10 shapes, wide offsets, memory estimates, and multiarray switches. The two S3-service tests were excluded because no local S3 service was running.

Fixes #294.

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.16988% with 41 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cpu/lod.cpp 80.83% 5 Missing and 18 partials ⚠️
src/cpu/stream.c 84.37% 0 Missing and 5 partials ⚠️
src/multiarray/stream.c 80.95% 2 Missing and 2 partials ⚠️
src/stream/config.c 87.87% 0 Missing and 4 partials ⚠️
bench/bench_input.c 50.00% 0 Missing and 2 partials ⚠️
src/cpu/stream.body.c 94.11% 0 Missing and 2 partials ⚠️
src/cpu/transpose.cpp 83.33% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
src/lod/lod_plan.c 88.49% <100.00%> (+0.06%) ⬆️
src/stream/dim_info.h 94.11% <100.00%> (-0.62%) ⬇️
src/stream/layouts.h 100.00% <100.00%> (ø)
src/util/index.ops.h 100.00% <100.00%> (ø)
src/cpu/transpose.cpp 90.69% <83.33%> (-0.87%) ⬇️
bench/bench_input.c 70.58% <50.00%> (+3.92%) ⬆️
src/cpu/stream.body.c 85.22% <94.11%> (+2.87%) ⬆️
src/multiarray/stream.c 78.15% <80.95%> (-0.07%) ⬇️
src/stream/config.c 78.41% <87.87%> (+1.18%) ⬆️
src/cpu/stream.c 81.92% <84.37%> (+0.01%) ⬆️
... and 1 more

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nclack nclack changed the title Map packed stream input directly into edge chunks Map packed input into edge chunks with scatter lookup tables Oct 4, 2026
@nclack
nclack marked this pull request as ready for review October 4, 2026 18:14
Compile column spans and joined rows from the lookup tables once per array.
Use those boundaries for bulk copies and tail clearing while retaining typed
scatter for short spans. Reuse a single column boundary when padded rows
cannot join, and include a conservative cache allowance in memory estimates.

Cover partial appends, worker splits, row padding, ragged multidimensional
spans, cache replacement, and multiarray switches with independent readback.
@nclack
nclack merged commit 576a210 into main Oct 4, 2026
9 checks passed
@nclack
nclack deleted the fix/packed-edge-input branch October 4, 2026 23:22
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.

CPU/GPU streams silently misread tightly packed frames with partial edge chunks

1 participant