Skip to content

fix(core): extend warm chunked open-ended reads from responses - #9232

Merged
Xuanwo merged 1 commit into
mainfrom
xuanwo/grow-warm-chunk-read-plan-candidate
Nov 27, 2026
Merged

Xuanwo merged 1 commit into
mainfrom
xuanwo/grow-warm-chunk-read-plan-candidate

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 27, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Refs #9196.

Rationale for this change

A reused chunked reader can silently truncate an open-ended read at the length observed by an earlier read. On Memory, warm a chunk-size-2 reader on 12345, overwrite the object with abcdefghi, then call read(2..) on the same reader. It returns cde before this change and cdefghi with it.

What changes are included in this PR?

  • For a nonempty, unhinted chunked open-ended read planned from earlier metadata, use the first successful buffered chunk in submission order that reports the full file length. If it reports growth, keep the original chunk ranges, including a short final chunk, and append exact ranges from the original end. This needs no probe request and preserves executor admission and whole-chunk retries.
  • Update FuturesAsyncReader's planned end for subsequent seeks after the read learns the longer length. The Memory regression test checks both the returned bytes and the adapter's relative end.
  • Across two local release runs on unchanged Memory reads, median time rose by about 9–12 ns per chunk (2.2%–2.8%) for both bounded and warm open-ended reads. Allocation count stayed constant and requested allocation bytes rose about 1%. Preserving a short final chunk at the original end can add one payload request compared with planning from the longer length initially.

Are there any user-facing changes?

A warmed open-ended read can now continue beyond the cached end when a completed chunk reports growth. SeekFrom::End uses the initial plan until the adapter learns a longer end. Reader::metadata() still exposes the first observation.

At the cached EOF an empty plan can still return EOF without a request; beyond it, direct reads and adapters keep their existing behavior. Explicit bounds, hints, and limits retain their existing semantics, as do shrink and responses that supply no full length.

Breaking changes

AI Usage Statement

  • Harness pi via T3, model magpie/codex/gpt-6.2-astra, effort high. Scoped the bounded warm-chunk growth repair and coordinated implementation, verification, and independent review.
  • Harness pi via T3, model magpie/codex/gpt-6.2-sol, effort max. Evaluated design alternatives against retry, admission, and cache controls, implemented the signed commit (734226c802), measured in-process Memory overhead, and verified the PR text against the accepted diff.
  • Harness pi via T3, model magpie/codex/gpt-6.2-sol, effort high. Independently reviewed the signed commit and reproduced the regression, ordering/overflow/cancellation edge cases, and cost measurements.
  • Harness pi via T3, model magpie/agy-cli/gemini-4-neon, effort high. Drafted the PR title and body.

Native Memory and Foyer exercised the read behavior locally. HTTP and layer fault controls used injected fixtures.

@Xuanwo
Xuanwo requested a review from tisonkun November 27, 2026 01:57
@Xuanwo
Xuanwo merged commit 78dc1c1 into main Nov 27, 2026
118 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/grow-warm-chunk-read-plan-candidate branch November 27, 2026 02:09
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.

2 participants