[GH-ISSUE #2622] [Bug]: PLE gather reissues already-prefetched reordered and duplicate keys #1046

Closed
opened 2026-11-04 01:48:00 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @hotschmoe on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2622

What happened

PleTable::gather_batch uses positional equality for Direct-mode prefetched keys. After prefetching A,B,C,D,E,F, gathering D,E,F,A,B,C reissues 96 requested rows even though every 16-row vector is already prefetched. Prefetching A once and gathering A,A,A reissues 48 requested rows because prefetches are deduplicated while the fast path requires at least as many slots as requested tokens.

Expected: reuse existing immutable prefetched slots and decode into requested order. This is a redundant-request mechanism; no serving latency or physical disk-I/O saving is claimed.

There is also a related cleanup defect in the same successful-match branch: on the first failed collect, it clears n_prefetch without draining subsequent outstanding tickets. A narrow proposed fix drains all tickets, preserves the first error, and returns without decoding after a failure. Failure handling is source-reviewed; runtime fault injection has not been performed.

Reproduction: open a finite tiny IQ4_NL GGUF in Direct mode, call prefetch_rows for the vectors above, and compare the requested-row counter in io_report before/after gather_batch. Exact executed fixture and evidence. The fixture's local include path needs adjustment outside its original checkout.

Strata version, GPU, OS

Upstream main 296b59d2f7 (0.1.44.1), Linux; CPU-only PleTable/PleReader/DirectFile reproduction, g++ 13.3.0, C++17/O2/pthreads. No GPU access required. Shared PleTable with the SYCL tree's host reader/file implementation was tested; full CUDA/HIP backend builds are not claimed.

Engine log

Both baseline and patched CPU harnesses exit 0, 44 cases per arm (88 total): 11 cases x cache 0/256 x worker off/on. All successful output bytes match an independently opened Mmap reference, and guards, finite references, logical byte accounting and request counts pass. Permutation: 96 -> 0 additional requested rows; duplicates: 48 -> 0; subset: 32 -> 0; extra-prefetch subset: 16 -> 0. Missing/over-limit/pending behavior retains expected counts. Runtime fault injection and out-of-range coverage are absent.

Searched existing issues/PRs on 2026-10-15 for PLE prefetch, gather_batch and prefetch_keys. Related PRs #1516, #2073 and #2326 touch this area but retain positional matching; no exact duplicate was found. Search is keyword-based, not an exhaustive review of every open diff.

Originally created by @hotschmoe on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/2622 ### What happened `PleTable::gather_batch` uses positional equality for Direct-mode prefetched keys. After prefetching A,B,C,D,E,F, gathering D,E,F,A,B,C reissues 96 requested rows even though every 16-row vector is already prefetched. Prefetching A once and gathering A,A,A reissues 48 requested rows because prefetches are deduplicated while the fast path requires at least as many slots as requested tokens. Expected: reuse existing immutable prefetched slots and decode into requested order. This is a redundant-request mechanism; no serving latency or physical disk-I/O saving is claimed. There is also a related cleanup defect in the same successful-match branch: on the first failed collect, it clears n_prefetch without draining subsequent outstanding tickets. A narrow proposed fix drains all tickets, preserves the first error, and returns without decoding after a failure. Failure handling is source-reviewed; runtime fault injection has not been performed. Reproduction: open a finite tiny IQ4_NL GGUF in Direct mode, call prefetch_rows for the vectors above, and compare the requested-row counter in io_report before/after gather_batch. [Exact executed fixture](https://github.com/hotschmoe/b70_ai_things/blob/fff2c71b0a1d806db428b8489b42fd248d50bebd/strata/flash-next/lowlevel_probe/ple_prefetch_cpu.cpp) and [evidence](https://github.com/hotschmoe/b70_ai_things/blob/fff2c71b0a1d806db428b8489b42fd248d50bebd/docs/20261015_strata_ple_prefetch_readiness.md). The fixture's local include path needs adjustment outside its original checkout. ### Strata version, GPU, OS Upstream main 296b59d2f73c8f04a805df29c2fa97655adace78 (0.1.44.1), Linux; CPU-only PleTable/PleReader/DirectFile reproduction, g++ 13.3.0, C++17/O2/pthreads. No GPU access required. Shared PleTable with the SYCL tree's host reader/file implementation was tested; full CUDA/HIP backend builds are not claimed. ### Engine log Both baseline and patched CPU harnesses exit 0, 44 cases per arm (88 total): 11 cases x cache 0/256 x worker off/on. All successful output bytes match an independently opened Mmap reference, and guards, finite references, logical byte accounting and request counts pass. Permutation: 96 -> 0 additional requested rows; duplicates: 48 -> 0; subset: 32 -> 0; extra-prefetch subset: 16 -> 0. Missing/over-limit/pending behavior retains expected counts. Runtime fault injection and out-of-range coverage are absent. Searched existing issues/PRs on 2026-10-15 for PLE prefetch, gather_batch and prefetch_keys. Related PRs #1516, #2073 and #2326 touch this area but retain positional matching; no exact duplicate was found. Search is keyword-based, not an exhaustive review of every open diff.
Author
Owner

@Niko1221 commented on GitHub (Oct 19, 2026):

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271133374 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1046
No description provided.