Skip to content

test(generator): pin that INC_RECURSE slices an already-materialised list - #7611

Merged
oferchen merged 2 commits into
masterfrom
test/inc-recurse-eager-scan-baseline
Sep 2, 2026
Merged

oferchen merged 2 commits into
masterfrom
test/inc-recurse-eager-scan-baseline

Conversation

@oferchen

@oferchen oferchen commented Sep 1, 2026

Copy link
Copy Markdown
Owner

What

Adds one test pinning the ordering that makes INC_RECURSE's segment machinery
unable to bound sender-side flist residency.

Why

The segment machinery is live. The generator pushes each sub-list onto
ndx_segments as it ships it (generator/protocol_io.rs, citing
flist.c:2966), and reclaim_oldest_segment runs from the transfer loop. What
is absent is upstream's lazy scan: send_directory / send1extra scan ONE
directory and emit ONE segment under send_extra_file_list(f, at_least), so
the whole tree is never resident.

oc calls build_file_list first and slices the finished list afterwards
(partition_file_list_for_inc_recurse). Peak residency is therefore taken
before the first segment ships, and no amount of downstream reclaim can lower
a peak already reached.

Nothing pinned that. The two existing reclaim tests hand-assign
ctx.incremental.ndx_segments, so they prove the mechanism given at least two
segments and say nothing about what production actually builds.

What the test records

Against a 3-directory / 6-file source:

  • all 10 entries (. + 3 dirs + 6 files) are resident before partitioning -
    this is the assertion the lazy producer has to move
  • partitioning yields exactly 3 sub-segments, one per directory: the same
    granularity send_directory emits, reached by slicing rather than scanning

Non-vacuity

Both assertions discriminate, measured:

  • dropping recursive from the config gives built=4 / resident_files=0
    (only . plus the three top-level dirs - the scan never descends) and the
    first assertion fails
  • short-circuiting partition_file_list_for_inc_recurse gives 0 segments:
    left: 0, right: 3, and the second assertion fails

Test-only; no production code is touched.

cargo fmt --all -- --check clean; cargo nextest run -p transfer generator::
424/424.

…list

The INC_RECURSE segment machinery is live on the sender: the generator
pushes each sub-list onto `ndx_segments` as it ships it and
`reclaim_oldest_segment` runs from the transfer loop. What is absent is
upstream's lazy scan. `send_directory` / `send1extra` scan ONE directory
and emit ONE segment under `send_extra_file_list(f, at_least)`, so the
whole tree is never resident. oc calls `build_file_list` first and slices
the finished list afterwards, so peak residency is taken before the first
segment ships - and no downstream reclaim can lower a peak already reached.

Nothing pinned that ordering. The two existing reclaim tests hand-assign
`ndx_segments`, so they prove the mechanism given >=2 segments and say
nothing about what production builds. This test records the current shape
against a 3-directory / 6-file source:

  - all 10 entries (`.` + 3 dirs + 6 files) are resident before
    partitioning, which is the assertion the lazy producer must move
  - partitioning yields exactly 3 sub-segments, one per directory - the
    same granularity `send_directory` emits, reached by slicing rather
    than by scanning

Both assertions discriminate. Dropping `recursive` from the config gives
built=4 / resident=0 and the first assertion fails; short-circuiting
`partition_file_list_for_inc_recurse` gives 0 segments and the second
fails.
@oferchen
oferchen merged commit da6956e into master Sep 2, 2026
70 checks passed
@oferchen
oferchen deleted the test/inc-recurse-eager-scan-baseline branch September 2, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant