Skip to content

fix(cost): price a CopyPlan by its footprint, not by a raised Copy row (#364, #363) - #424

Merged
shinaoka merged 16 commits into
mainfrom
fix/363-copy-rate
Nov 9, 2026
Merged

shinaoka merged 16 commits into
mainfrom
fix/363-copy-rate

Conversation

@shinaoka

@shinaoka shinaoka commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Rebuild of this branch: it implements #364 item 2 instead of raising the Copy row. The withdrawn head raised copy_ns_per_element_of(X86_64Avx512) from 0.171 to 0.500, which #364 item 3 forbids, which still left 3.09 / 0.500 = 6.18x of error on its own acceptance case, and which moved the widths of the strided_perm::copy_into engine. No row of the class table moves here: strided-perm/ is byte-identical to main.

Head f893cab: the branch was rebased onto main after #429 landed, so it carries one merge commit (a2a28f1); worklog in docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md.

What it does

CopyPlan::compile now records the reach of each side (1 + sum((dim - 1) * |stride|)), and the replay forms the plan's working set in bytes as dst_span * size_of::<D>() + src_span * size_of::<S>() — each side at its own element size, each operand counted once. The element size is the one fact compile cannot know; there is no runtime probing, so this stays a compile-time plan property.

cost::copy_ns_per_element_for_footprint (crate-internal) answers the class's beyond-L2 copy rate past the class's 1 MiB L2 and the row otherwise. On x86_64-avx512 that rate is 3.0 ns per element. A plan whose replay walks it as one unit-stride run (reversed -1 runs included) keeps the row at every footprint, which is what #364 item 3 asks: contiguous callers' widths do not move. "Walks" is literal: is_contiguous_run reads the fused axes in the order both replays walk them (axis 0 fastest), not in an order the layout would allow.

Dense reversed buffers: option (a), the exemption follows the replay's order

A dense reversed buffer of rank two or more ([-1, -512] over [512, 512], or the spilled rank-9 [-1, -4, ..., -65536]) is not one run in the replay: fusion sorts by signed destination stride (strided-basic/src/raw_ops.rs:175-180), so it walks -512 / -65536 fastest (raw_ops.rs:632, raw_ops.rs:730). The previous head exempted it by matching strides in ascending magnitude. It is now priced as the strided walk it actually is (CopyPlan::is_contiguous_run, strided-basic/src/copy_plan.rs:314).

I chose this over (b), re-sorting fusion by sign group and magnitude so that the buffer becomes one run, because that sort is not the plan's own. fuse_pair_traversal / fuse_pair_layout also feed UpdatePlan, both gather plans and copy_scale_raw / copy_scale_conj_raw / axpy_raw / axpy_conj_raw (raw_ops.rs:271,898,929,960,991, gather_plan.rs:1084,1453). (b) would therefore change the visit order of every one of those families, and with it the accumulation order of axpy_raw over a non-injective destination. That is a traversal change with its own benchmark obligation (REPOSITORY_RULES § Performance), not a costing change for #364. The walk itself is main's and is left as it is; it is listed as a residual in the worklog (sec. 6).

The plan's rate is the one every scheduling decision asks at: the width of the replay that is not tiled (for_len_at_rate) and both the fork gate and every node of the recursive splitter of the tiled replay of #422 (is_parallel_at_rate, threading::mapreduce_threaded_at_rate) instead of KernelClass::Copy. A budget is not narrowed for the tiled replay, so a caller's width stays the caller's and only the decision to fork moves. UpdatePlan, both gather plans and the plan-free replay_*_raw entries keep the row. The host class is a parameter of the private CopyPlan::replay_on / ns_per_element_on (replay passes HostClass::detect()), so the tests can name it. #364's item 1 (a per-segment term) is not in this change.

Acceptance (#364: 512x512 transposing f64, serial, factor of about 2)

case measured source plan estimate estimate / measured
512x512 3.09–3.24 quoted from #364's table (Xeon 9242) 3.0 3.0/3.24 = 0.93, 3.0/3.09 = 0.97 → met
512x512 2.42–2.43 measured here today 3.0 3.0/2.43 = 1.23 → met
1024x1024 2.44 measured here today 3.0 3.0/2.44 = 1.23 → met
256x256 1.339 measured here today 0.171 (1 MiB set, the row) 1.339/0.171 = 7.8 → not met
128x128 0.663 measured here today 0.171 (256 KiB) 0.663/0.171 = 3.9 → not met

#364's scheduling criterion is the width at budget 96 within one step of width_for(measured_serial, 1) on the transposing rows. A test now checks it for the width rule at the plan's rate (for_len_at_rate; a_transposing_plan_rate_past_l2_gives_the_width_of_its_measured_time). It uses the x86_64-avx512 dispatch costs and a root token dispatching from outside the pool. The measured values are #364's Xeon 9242 table, quoted.

n plan rate plan width width_for(measured) width at the row
64 0.171 1 1, 1 1 agrees (no width pays)
128 0.171 1 1 1 agrees (no width pays)
256 0.171 1 6, 7 1 not met (fits L2, #364 item 1)
512 3.0 23 24, 24 6 met, pinned by the test
1024 3.0 47 46, 47 11 met, pinned by the test

The tiled placement does not meet it. These transposing layouts take the tiled replay of #422, which does not narrow the budget (copy_plan.rs replay_tiled hands exec to the splitter unnarrowed, as on main). Replayed through replay_on(X86_64Avx512, ..) with a 96-thread pool at budget 96, the splitter records 96 leaves for both 512² and 1024² (1 install; max_live 21 and 17 on this Mac). The plan-width column above is therefore the width rule's answer, not the participant count of the replay these layouts take. Narrowing the tiled replay to that width would change #422's scheduling without a measurement, so it is not done here; that gap is strided-rs#430. The test now executes that replay for both rows against a 96-slot token and asserts the leaf count, so the numbers above are a measurement rather than a claim. The spilled tiled branch (rank above the inline limit) now forwards the same rate to its outer gate and splitter, which it did not before this commit; a_spilled_tiled_plan_past_l2_prices_its_splitter_at_its_own_rate covers it and fails when the rate is dropped.

The rows that fit L2 keep the row and stay 2.7–7.8x low on today's measurements (9.1–9.3x on the pre-#422 numbers of the withdrawn worklog, quoted). Those rows are #364 item 1, not item 2; raising the row would still miss the criterion (3.09/0.500 = 6.18x, 1.56/0.500 = 3.12x) while moving every contiguous caller's width.

The calibration is of the tiled transposing path. The replay that is not tiled is not calibrated row by row: a rank-1 run at stride 256 (one element per 2 KiB) measured 9.8 ns per element while a co-tenant process shared the measured CPU set. A contended sample cannot establish the uncontended value, so this is recorded as an observation and no direction or ratio is claimed for the gap; a run long enough to fill a cache line was not measured. The "up to 3x high" bound of the earlier revision had no measurement behind it and is withdrawn.

Performance

Parallel CopyPlan: measured on an AVX-512 host. EVO-X2 (Ryzen AI MAX+ 395, Zen 5, 32 threads),
public CopyPlan::execute, medians of 41 repetitions after 4 warmups, three runs per tree, full
output validated against the strided oracle outside the clock:

cell base edcf71f head f893cab ratio
1t, 512x512 transposing (tiled) 2.290 / 2.396 / 2.398 ns/el 2.400 / 2.401 / 2.412 1.01-1.05
4t, 512x512 transposing (tiled) 0.585 / 0.602 / 0.613 0.599 / 0.605 / 0.609 0.99-1.02
1t, rank-1 stride 256 (untiled) 9.45 / 9.76 / 9.99 9.73 / 9.79 / 9.81 0.98-1.03
4t, rank-1 stride 256 (untiled) 9.64 / 9.77 / 9.99 9.85 / 9.90 / 9.96 0.99-1.03

Host load was 3.3-3.7 throughout (other users), and the base's own 1t spread is 4.7%, so the run
resolves no single-digit difference; it does show no move outside the host's noise in any cell and
none at all in the untiled cell (which stays serial at 4 slots, as pricing it at 3.0 predicts).
A quiet-host 8+ slot run and a spilled-tiled parallel row remain unmeasured.

The tables below are serial CopyPlan and the unchanged strided_perm::copy_into engine.

strided_perm::copy_into, before (main) and after (this commit), same harness and placement

Median of 41 warm repetitions, budget 16, measured process pinned to cpus 0-7,16-23 (one L3 domain), observer on 8-15,24-31; nanoseconds per element, microseconds in brackets.

case main b2358fb withdrawn head 1417eb5 (row 0.500) this commit
128x128 transpose 0.320 [5.24 us] 0.321 [5.26 us] 0.319 [5.23 us]
4096 contiguous 0.154 [0.63 us] 0.151 [0.62 us] 0.151 [0.62 us]
512x512 transpose 0.348 0.271 0.355
1024x1024 transpose 0.200 0.287 0.201

copy_into is main's within run-to-run noise (0.315–0.320, 0.151–0.156 over five runs), and its width is main's by construction (the file is unchanged). The withdrawn head's worklog recorded 5.00 → 6.16 us (+23.2%) at 128x128 and 0.70 → 0.90 us (+28.6%) at 4096 for this engine; those two rows did not reproduce here on either tree — with the host's default dispatch costs the engine's first section costs 9.7 us (the Outside row) against its 2.8 us estimate, so it stays at width 1 and the row cannot reach its width. At sizes where it does reach the width (512x512: width 6 → 10, 1024x1024: 11 → 16), the row moves it and the time moves in both directions, which is why #364 item 3 says not to move the row.

CopyPlan::execute serial, n x n f64, ns per element, measured here today: 512x512 2.421/2.423/2.429 (this commit) against 2.411/2.418/2.425/2.757 (main) and 7.340/7.397/7.665 (withdrawn head); contiguous 0.175–0.177 in all three.

Red then green (this round, review of 08895fd)

Run on Apple M-series (aarch64-apple), 2026-11-09. Full logs were kept; the lines below are copied out of them.

NEEDS 1, the exemption against the actual walk. the_contiguous_exemption_is_the_walk_the_replay_takes replays seven layouts serially. Its apply closure records each (destination slot, source slot) visit, and the test asserts is_contiguous_run() == (the recorded walk is one unit-step run per side), plus the price on x86_64-avx512 (row when it streams, 3.0 when it does not). The layouts are dense forward, reversed rank 1, dense reversed, dense reversed spilled, forward into reversed, mixed signs, and transpose, all past L2. Against 08895fd's is_contiguous_run:

test copy_plan::tests::the_contiguous_exemption_is_the_walk_the_replay_takes ... FAILED
assertion `left == right` failed: dense reversed: the plan claims one streamed run = true, but the replay walked 262017 run(s) (first visits [(262143, 262143), (261631, 261631), (261119, 261119), (260607, 260607)])
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 257 filtered out
# spilled case put first:
assertion `left == right` failed: dense reversed, spilled: the plan claims one streamed run = true, but the replay walked 262144 run(s) (first visits [(262143, 262143), (196607, 196607), (131071, 131071), (65535, 65535)])
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 257 filtered out

With the walk-order check:

test copy_plan::tests::the_contiguous_exemption_is_the_walk_the_replay_takes ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 257 filtered out

NEEDS 2, forwarding tests that cannot skip. Mutation: the rate handed to replay_fused is pinned to KernelClass::Copy.ns_per_element(). On 08895fd, on this host, both forwarding tests return early and count as passes:

skipped: this class has no beyond-L2 copy rate
test copy_plan::tests::a_strided_plan_past_l2_splits_its_tiled_replay_at_its_own_rate ... ok
skipped: this class has no beyond-L2 copy rate
test copy_plan::tests::a_strided_plan_past_l2_forks_untiled_at_its_own_rate ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 254 filtered out

They now replay through replay_on(HostClass::X86_64Avx512, ..), with the same plan at HostClass::Generic as a control that must not fork. They also assert that the row of either class does not pay the pool's fork. Same mutation, same host:

test copy_plan::tests::a_strided_plan_past_l2_forks_untiled_at_its_own_rate ... FAILED
test copy_plan::tests::a_strided_plan_past_l2_splits_its_tiled_replay_at_its_own_rate ... FAILED
the plan forked nowhere: the replay priced it at the row, not at 3.000 ns per element
the splitter did not fork: 0 leaf/leaves and 0 worker install(s) for a plan priced at 3.000 ns per element
test result: FAILED. 36 passed; 2 failed; 0 ignored; 0 measured; 220 filtered out

The acceptance test a_strided_plan_past_l2_prices_itself_above_the_contiguous_row no longer branches on HostClass::detect() either. It names X86_64Avx512, and every class without a beyond-L2 rate.

Footprint branch removed (copy_ns_per_element_for_footprint answers the row): five tests fail, among them the new width test:

test result: FAILED. 33 passed; 5 failed; 0 ignored; 0 measured; 220 filtered out
512 x 512: the plan asks for width 6 at 0.171 ns per element, the measured 3.09 ns per element wants 24

Restored, all green (below). The mutation records of the earlier rounds (1a/1b/2/3) are in the worklog, sec. 5; they were run on the Zen 5 host against the earlier revision.

Verification

Parallel CopyPlan scheduling (the rate, the fork gate, and the tiled splitter) has no performance evidence: the appendix harness runs every plan with Exec::serial(), so its timings cannot exclude a regression from the changed scheduling estimate. This is stated as unverified, not as measured.

Run on head 5354bb4 (and, after the test rename in d176872, cargo test --workspace again: 78 binaries, passed=1146 failed=0; both clippy runs exit 0), Apple M-series. Those runs predate the rebase through a2a28f1 and the later f893cab; for f893cab the evidence is hosted CI only — every required check completed green. No local run of that exact head is quoted.

$ cargo fmt --all -- --check                                   # exit 0
$ cargo clippy --workspace --all-targets -- -D warnings          # exit 0
$ cargo clippy --workspace --features strided-basic/parallel,strided-kernel/parallel,strided-fused/parallel,strided-perm/parallel --lib --tests --examples -- -D warnings   # exit 0
$ RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps     # exit 0
$ python3 scripts/repository-rules-review.py --base origin/main --worktree --dry-run
Verdict: pass
$ cargo test -p strided-basic --features parallel copy_plan > log 2>&1; echo exit=$?
exit=0      # 34 "test result: ok" lines, none with a nonzero failed count, passed=44 failed=0
$ cargo test --workspace > log 2>&1; echo exit=$?
exit=0      # 78 binaries, passed=1146 failed=0
# CI lane "parallel" (-p strided-traits -p strided-view -p strided-basic -p strided-perm -p strided-fused -p strided-kernel, parallel features)
exit=0      # 76 binaries, passed=1174 failed=0
# CI lane "no-default-features" (-p strided-traits -p strided-view -p strided-basic -p strided-perm -p strided-fused)
exit=0      # 61 binaries, passed=924 failed=0
# CI lane "parallel-no-simd"
exit=0      # 61 binaries, passed=979 failed=0

Counts are summed over every test result: line of the whole, unfiltered log (awk '/^test result:/ {p+=$4; f+=$6}').

Not measured: a hosted GPU gate (no CUDA code in this change) and the reporting Xeon Platinum 9242 of #363 (not available here; its table enters as quoted constants).

The worklog's appendix carries the harness source, the exact commands, the Exec::serial() / Exec::new(pool, 16) configuration and every run with its load average, so each number above can be re-run and re-checked.

review: gpt-6.1-sol needs-changes (round 4, 08895fd): both NEEDS were real and are fixed in 5354bb4. (1) The dense-reversed exemption now follows the replay's walk order, option (a) above, with an executed walk-recording test. (2) The forwarding tests name the host class and fail under the forwarding mutation on every host. Of the two UNVERIFIED items, the budget-96 width comparison is now a test of the width rule (512/1024 met, 256 not met), and parallel CopyPlan performance is stated as not measured, with the reason.

review: gpt-6.1-sol needs-changes (round 3) — all three items are fixed in 246e89b: the tiled test now requires more than one splitter leaf and at least one worker install (mutation 2 above, the splitter handed the row while the outer gate keeps the rate, fails with 1 leaf/leaves and 0 worker install(s)), strided-basic/src/cost.rs's module doc now states that both the tiled gate and the splitter ask at the plan's rate, and the worklog's mutation record now shows the runs that actually happened (1a/1b/2/3) plus the calibration appendix.

review: gpt-6.1-sol needs-changes (round 2) — both NEEDS were real and are fixed in 70444ad: the plan's rate now reaches the tiled replay's fork gate and recursive splitter (is_parallel_at_rate, mapreduce_threaded_at_rate), and the regression tests now execute the plan and count workers/leaves, with a reversed run whose footprint is 2 MiB (2 mutations shown above failing). Both UNVERIFIED items are addressed by narrowing the claim to the tiled path (the untiled/spilled rows are stated as not calibrated, with the one indicative measurement labelled) and by the host-independent AVX-512 test. Round 1's findings (footprint counted both operands twice; reversed runs re-priced; a needless public function on the permutation crate; a tautological width pin; unsupported numeric bounds) are also fixed.

review: gpt-6.1-sol needs-changes (round 5, 5354bb4). The NEEDS was real: the budget-96 test checked for_len_at_rate, which the tiled replay these layouts take does not use (96 leaves at budget 96, reproduced). The test is renamed to the claim it supports, and the body and worklog now state that the tiled placement does not meet #364's criterion (open decision, above). UNVERIFIED: parallel CopyPlan performance is still not measured (stated above). The untiled-underpricing ratio rests on co-tenant runs only and is unverified as a ratio. Hosted CI for the new head is pending at the time of writing.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Repository rules review

Repository rules review (edcf71fafb91f949553fb3f7d6df94af6a0d6e04...f893cabd4fe32503e5020ae59d8ee7c5ab3f520e)
Verdict: pass
Findings:
- [warn] llm-skipped (External LLM Review) <unknown>: External LLM review was skipped
  External LLM review is permanently disabled; deterministic checks only.

@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 3
UNVERIFIED: 3

Critical (must not merge)

none

Needs changes

  • The constant change contradicts the agreed implementation scope and still fails its acceptance case — strided-perm/src/host.rs:62. Issue #364, explicitly implementing KernelClass::Copy rate is 4-19x below the measured cost of strided transposes on a Xeon AVX-512 host, so their width is chosen for a much smaller job #363, says “Do not raise the x86_64-avx512 constant,” requires plan geometry/footprint costing, and preserves contiguous callers’ widths; this change instead raises every caller’s estimate without either plan term. Reproduce: compare that issue’s Change items 1–3 against this line, then divide its recorded 512×512 serial rate, 3.09–3.24 ns/element, by the new 0.500: the estimate remains 6.18–6.48× too low, outside its approximately 2× acceptance target. Calling this a mitigation does not establish approval to reverse that scope or close KernelClass::Copy rate is 4-19x below the measured cost of strided transposes on a Xeon AVX-512 host, so their width is chosen for a much smaller job #363.

  • The shared row introduces recorded regressions in another public copy engine — strided-perm/src/host.rs:62, consumed by strided-perm/src/copy.rs:127–132. The PR’s own worklog, docs/worklogs/2026-11-09-issue-363-copy-rate.md:88–100, records strided_perm::copy_into slowing from 5.00 to 6.16 µs (+23.2%) for a 128×128 transpose and 0.70 to 0.90 µs (+28.6%) for a 4096-element contiguous copy. Reproduce: compare the parent and head through that public entry with f64, budget 16, and the recorded CPU placement; these are the worklog’s reported results, not measurements I reran. The change applies a CopyPlan compromise to an engine with a different measured curve; attributing some loss to the unchanged width model does not remove the regression introduced by changing its input.

  • The published calibration bounds contradict the submitted numbers — strided-perm/src/host.rs:30–38, strided-basic/src/cost.rs:97–100, and docs/worklogs/2026-11-09-issue-363-copy-rate.md:37–39. The API documentation says beyond-L2 underestimation is “up to 15x,” while its own upper rate gives 9.7 / 0.5 = 19.4×; the worklog also says the contiguous column agrees with 0.171 within 20%, although listed values include 0.12 and 0.35. Reproduce: calculate 0.12 / 0.171 - 1 and 0.35 / 0.171 - 1: approximately −29.8% and +104.7%. Correct the bounds and qualify which samples actually support the claimed agreement.

Unverified claims

  • The benchmark results and median selection cannot be reproduced from the submission — docs/worklogs/2026-11-09-issue-363-copy-rate.md:104–108,147–162. The harness, measurement-only source override, and raw samples are absent; the private harness/override cannot read. Verification attempt: follow the Reproducer section—the supplied command names an unavailable executable and does not provide its implementation or override patch. Consequently, the claimed medians and before/after timings remain unverified. The additional assertion that checking one element makes a wrong traversal fail is insufficient: corrupt any unchecked destination element while preserving the checked one, and that assertion cannot detect it.

  • Matching actual dispatch overhead across the two hosts is not established — strided-perm/src/host.rs:50–59 and docs/worklogs/2026-11-09-issue-363-copy-rate.md:135–143. No independent dispatch-timing harness or raw timing samples support the stated 0.6/0.7/0.98 µs measurements. Verification attempt: evaluate DispatchCosts::for_class(HostClass::X86_64Avx512).cost(...), as the new test does at strided-basic/src/threading/tests/tests.rs:84–86; this retrieves the selected model, not a measurement of the executing host. Agreement between reported model values cannot establish the claimed hardware pairing.

  • Contiguous-copy measurements do not establish the asserted cost bound for fills, gathers, and indexing plans — docs/worklogs/2026-11-09-issue-363-copy-rate.md:123–128. The text explicitly says these operations were not measured, then asserts their per-element cost is at most a contiguous copy’s. Verification needed: measure, for example, a gather whose source accesses span separate cache lines outside cache, rather than substituting contiguous-copy timings. No such evidence appears in the diff, so the claimed bound and performance implications remain unverified.

Checked and fine

CI run 42569730917 identifies head 1417eb5cdb5cd4536a0af97d89faa6f45c57bfd7; Linux/macOS tests and feature-lane jobs completed successfully.
The clippy job log contains successful workspace lint commands; it is not evidence that the locally reported clippy failure was reproduced.
Not rerun: Rust tests or hardware benchmarks; performance conclusions above distinguish submitted measurements from independently checked arithmetic.


Reviewed head: 1417eb5cdb5cd4536a0af97d89faa6f45c57bfd7 at 2026-11-09T06:08:27Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

@shinaoka shinaoka self-assigned this Nov 9, 2026
@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 2
UNVERIFIED: 3

Critical (must not merge)

none

Needs changes

  • The global rate change contradicts the agreed implementation scope and changes contiguous callers’ widths — strided-perm/src/host.rs:62. Issue plan cost: cost a CopyPlan by segments and footprint, not by a flat per-element class rate (#363) #364 explicitly says “Do not raise the x86_64-avx512 constant” and requires existing contiguous callers to retain their widths; this change instead affects both CopyPlan replay (strided-basic/src/copy_plan.rs:760) and the permutation engine (strided-perm/src/copy.rs:127–154). Reproduction: compare both revisions using an AVX-512 team with budget 16 and a contiguous 4,096-element f64 copy; the committed worklog records width 1 → 3 for CopyPlan, and strided_perm::copy_into latency 0.70 → 0.90 µs, a 28.6% regression (docs/worklogs/2026-11-09-issue-363-copy-rate.md:66,88–97), although I did not independently reproduce those timings. Reconcile this scope change with KernelClass::Copy rate is 4-19x below the measured cost of strided transposes on a Xeon AVX-512 host, so their width is chosen for a much smaller job #363/plan cost: cost a CopyPlan by segments and footprint, not by a flat per-element class rate (#363) #364 before using Closes #363: the required beyond-L2 estimate remains unmet, as the worklog itself acknowledges at lines 110–116.

  • The acceptance and error-bound claims fail arithmetic against the committed measurements — docs/worklogs/2026-11-09-issue-363-copy-rate.md:31–36, strided-basic/src/cost.rs:97–100, and strided-perm/src/host.rs:37–38. Reproduction: divide the recorded 256×256 transpose rate by the new row, 1.56–1.59 / 0.500 = 3.12–3.18; this contradicts the PR body’s “within 1.1x (256x256)” acceptance claim, while 9.68 / 0.500 = 19.36 contradicts the public documentation’s “up to 15x” / “about 15x” residual. The worklog’s “contiguous rate … within 20%” claim at lines 38–39 also fails for its own 0.31–0.35 measurements: these are 81–105% above 0.171. Correct the claims and do not present the recorded table as satisfying the issue’s small-factor acceptance target.

Unverified claims

  • The benchmark results and calibration operands cannot be reproduced from the committed artifacts — docs/worklogs/2026-11-09-issue-363-copy-rate.md:104–108,147–161. The width sweep depends on a throwaway crate and an uncommitted measurement-only rate override; cannot read either implementation or the raw samples. Reproduction attempt: follow section 6 at the supplied head SHA; the only executable instruction is repro363 <budget> ..., without its source or the override needed to force the measured widths. Consequently, the reported medians, timing boundaries, effective widths, and before/after comparisons remain unverified.

  • Matching dispatch-table values do not establish matching measured dispatch overhead on the two hosts — strided-perm/src/host.rs:50–59 and docs/worklogs/2026-11-09-issue-363-copy-rate.md:135–143. The PR asserts independently measured agreement at widths 2, 4, and 8, but commits neither the dispatch-timing harness nor its samples; cannot read that evidence. Reproduction: the added test at strided-basic/src/threading/tests/tests.rs:84–94 obtains costs through DispatchCosts::for_class(...), which checks model values without measuring dispatch, so its success cannot substantiate the cross-host pairing claim.

  • The claimed contiguous-copy upper bound for fills, gathers, and indexing is unsupported — docs/worklogs/2026-11-09-issue-363-copy-rate.md:123–128. The text explicitly says these callers were not measured, then asserts their per-element cost is “at most” a contiguous copy’s cost. Reproduction needed to establish that bound: include a gather with widely separated or randomized source indices and compare it with a contiguous copy of the same output length under identical execution conditions; no such result is committed, and the copy timings listed here do not establish it.

Checked and fine

  • CI run 42575134582 reports success for head c4ba10300ee38c2e4c7a991ea67de4f5d7066e7e; its configured feature lanes are not stale-head evidence.
  • Not checked: local Rust tests, mutation tests, or hardware timings; performance findings above distinguish recorded results from independently verified arithmetic.

Reviewed head: c4ba10300ee38c2e4c7a991ea67de4f5d7066e7e at 2026-11-09T07:14:22Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

@shinaoka shinaoka changed the title fix(cost): price transposing copies in the Copy row; 0.500 on x86_64-avx512 (#363) fix(cost): price a CopyPlan by its footprint, not by a raised Copy row (#364, #363) Nov 9, 2026
@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 2
UNVERIFIED: 2

Critical (must not merge)

none

Needs changes

  • The acceptance layout discards the new rate before making any scheduling decision — strided-basic/src/copy_plan.rs:852–858: the 512×512 transposing f64 plan takes replay_tiled, which returns before for_len_at_rate; its gate and recursive splitter still receive KernelClass::Copy at lines 920 and 947, so the new 3.0 rate cannot correct that execution’s width as required by plan cost: cost a CopyPlan by segments and footprint, not by a flat per-element class rate (#363) #364’s acceptance criteria. Reproduce: compile [512, 512] with destination strides [512, 1] and source strides [1, 512], assert that pair_tiles::<f64, f64> returns Some, and trace execution through replay_fused_raw; the computed rate never reaches either scheduling decision. The worklog acknowledges this omission, but calling it an “estimate fix” does not supply the missing width behavior.

  • The regression test cannot detect broken rate forwarding or the reversed-run regression it claims to prevent — strided-basic/src/copy_plan/tests/tests.rs:623–668: it reads the private rate and invokes the gate directly, without executing the plan, while its reversed example occupies only 4096 × 8 × 2 = 65,536 bytes and therefore keeps the row even if the reversed-run exemption is broken. Reproduce independently: (1) replace the rate passed by CopyPlan::replay at copy_plan.rs:373 with KernelClass::Copy.ns_per_element(); none of this test’s assertions depends on that argument; (2) replace both unsigned_abs() == 1 checks in is_contiguous_run with == 1; the reversed assertion still receives the below-L2 row. Add an executed, untiled dispatch assertion and a reversed run whose combined footprint exceeds 1 MiB.

Unverified claims

  • The calibration does not establish the rate for the execution paths that actually consume it — strided-basic/src/cost.rs:92–105 and docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:143–150: the cited measurements are tiled transposes, but the new rate affects untiled inline and spilled traversals; the additional “longer runs … up to 3x high” bound has no corresponding measurement rows. Verification procedure: measure a beyond-L2 layout for which pair_tiles returns None, and a fused-rank-above-eight layout reaching replay_spilled_raw, then compare their serial times with 3.0 ns/element. I cannot read a benchmark harness or raw samples supporting those bounds from the supplied diff.

  • Green hosted checks do not establish that the AVX-512 acceptance assertions executed — strided-basic/src/copy_plan/tests/tests.rs:637–652: the substantive acceptance and threshold-crossing assertions are conditional on the detected host, and the inspected CI output records the test as ok without recording which branch ran. Reproduce: on a non-AVX-512 host, replace copy_ns_per_element_for_footprint with an unconditional row lookup and run cargo test -p strided-basic a_strided_plan_past_l2; the test still passes. Exercise the explicit HostClass::X86_64Avx512 helper independently of runner hardware.

Checked and fine

  • GitHub comparison confirms one commit above b2358fb and no changed files under strided-perm/.
  • The inspected build/test check records reference head 87d0237c476196336028f61122e66d05f492c142; the repository-review LLM lane is skipped.
  • Not run: local builds, mutation tests, or benchmarks; reproductions above are source-derived, not measured execution results.

Reviewed head: 87d0237c476196336028f61122e66d05f492c142 at 2026-11-09T07:38:39Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

@shinaoka
shinaoka force-pushed the fix/363-copy-rate branch 2 times, most recently from 70444ad to c7cdf20 Compare November 9, 2026 08:13
@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 2
UNVERIFIED: 2

Critical (must not merge)

none

Needs changes

  • The tiled regression test does not prove that the recursive splitter forks — strided-basic/src/copy_plan/tests/tests.rs:795-799. Reproduce on AVX-512 by replacing only the ns_per_element argument at strided-basic/src/copy_plan.rs:962 with KernelClass::Copy.ns_per_element(), then running cargo test --release --lib -p strided-basic --features parallel a_strided_plan_past_l2_splits_its_tiled_replay_at_its_own_rate. The outer gate still receives 3.0, but the splitter receives 0.171 and invokes its leaf callback without forking (strided-basic/src/threading.rs:494-495); that callback records one leaf, satisfying !leaves.is_empty() despite the broken forwarding. The separate explicit-rate splitter test bypasses this call site and cannot catch it. Assert multiple leaves or worker installations. This is a source-traced mutation escape; I did not execute the mutation.

  • The scheduling documentation contradicts the implementation — strided-basic/src/cost.rs:57-58. The module documentation says the tiled replay gates its forks on the class, while strided-basic/src/copy_plan.rs:935 and :956-962 use the plan’s explicit rate for both the entry gate and recursive splitter. Reproduce the discrepancy by tracing the existing 128×32, beyond-L2 test: the documented class rate is 0.171, while the implemented AVX-512 plan rate is 3.0. Update the documentation so it does not describe the behavior this PR is specifically removing.

Unverified claims

  • The reported mutation transcript cannot be attributed to the mutation as described — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:148-158. It says pinning the rate passed by CopyPlan::replay makes the pricing assertion fail with 0.171, but that assertion obtains its rate directly from strided.ns_per_element::<f64, f64>(), without executing replay (strided-basic/src/copy_plan/tests/tests.rs:622-645). Reproduce by changing only the replay-local rate at strided-basic/src/copy_plan.rs:360 and running the pricing test: that edit cannot change the directly queried rate. Cannot read the exact mutation patch or original run log; provide them or replace the transcript with evidence from the stated mutation on this head.

  • The measured calibration and “within run-to-run noise” claims are not independently reproducible from the supplied artifacts — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:16-25,87-115. These tables support the 3.0 constant and the performance-preservation claim, but the worklog supplies neither the exact harness invocation nor the per-run recordings needed to reproduce the comparisons. Cannot read those measurement artifacts. Reproduction requires the harness, explicit serial execution configuration, exact tree identities, and recordings for each compared case; arithmetic against the quoted medians does not establish measurement validity.

Checked and fine

  • The comparison against b2358fb contains one commit and no changes under strided-perm/.
  • CI run 42584338762 reports success for head c7cdf20; the AVX2/Apple early returns at tests.rs:751-757 still leave plan-to-splitter forwarding unexercised on those classes.
  • Not checked: local Rust tests, executable mutations, or benchmarks; scheduling mutation coverage remains incomplete.

Reviewed head: c7cdf20d792772427ebf1014ce7251e64fcd54c0 at 2026-11-09T08:28:21Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 2
UNVERIFIED: 2

Critical (must not merge)

none

Needs changes

  • Dense multidimensional reversed layouts lose the contiguous-rate exemption — strided-basic/src/copy_plan.rs:304–306. On AVX-512, compile CopyPlan::compile(&[512, 512], &[-1, -512], &[-1, -512]) and, from the unit-test module, assert that ns_per_element::<f64, f64>() equals the Copy row: source tracing gives 3.0 instead of 0.171. Both operands cover dense contiguous buffers, but raw_ops.rs:175–195 sorts signed strides into [-512, -1], preventing fusion into rank one; the new classifier consequently changes their scheduling estimate by 17.54×, contrary to the unchanged-contiguous-width claim. The rank-one reversed test at copy_plan/tests/tests.rs:813–825 cannot detect this case. Recognize this multidimensional reversed layout and add the failing regression case.

  • Removing the plan-specific rate can still pass the new tests on non-AVX-512 hosts — strided-basic/src/copy_plan/tests/tests.rs:637–652,702–708,751–757. Reproduce on Apple or AVX2 by replacing CopyPlan::ns_per_element with KernelClass::Copy.ns_per_element() and running cargo test -p strided-basic --features parallel --lib copy_plan::tests: the pricing assertion explicitly expects the row, both executed forwarding tests return early, and the explicit-rate splitter test bypasses CopyPlan entirely. The separate cost-helper test also cannot detect this mutation because its helper remains unchanged. Thus these tests do not protect the plan-to-scheduler connection on those hosts; the worklog’s statement that this mutation “fails on every host” at docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:148–151 contradicts the control flow. Exercise the actual plan replay under an explicit AVX-512 pricing context, or provide an enforced AVX-512 test lane.

Unverified claims

  • The measured calibration and unchanged-runtime claims lack reproducible measurement artifacts in this diff — strided-basic/src/cost.rs:94–109 and docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:16–35,87–113. The diff contains asserted medians but not the harness, invocation, or raw samples needed to reproduce the 2.42–2.43 ns calibration and the copy_into before/after comparison; cannot read those measurement artifacts from the supplied change. Reproduce by supplying the harness and exact commands for base b2358fb and head 9ce8387, including the effective serial execution configuration and sample output.

  • Completed CI for the submitted head is not established — .github/workflows/ci.yml:85–86,206–207,245–248. At inspection, workflow run 42587198553 identified head 9ce8387b44f949644daaa87a3e5248de9acbf7d1 but remained in_progress with no conclusion; test, feature-lane, Clippy, and coverage checks were unfinished. Reproduce with gh api repos/tensor4all/strided-rs/actions/runs/42587198553 --jq '{head_sha,status,conclusion}'. The quoted local logs do not establish the eventual hosted result, and the two forwarding tests can report success through early returns even after that run finishes.

Checked and fine

none

Not checked: Rust tests, mutations, and benchmarks were not executed here; the reproduction outcomes above are source-traced, not runtime measurements.


Reviewed head: 9ce8387b44f949644daaa87a3e5248de9acbf7d1 at 2026-11-09T08:36:37Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

`CopyPlan` priced every copy at the `Copy` row (0.171 ns per element on
`x86_64-avx512`), which is the L2-resident contiguous rate. A working set past
the class's L2 cache whose traversal touches a new cache line per element pays
about 3.0 ns per element there, so the row under-priced a 512x512 transposing
copy by 6-19x and the width rule picked a width for a job that much smaller.

`compile` now records the span of each side, and the plan forms its footprint in
bytes at replay, each side at its own element size (the one fact `compile`
cannot know), so this stays a compile-time plan property with no probing. The
crate-internal `copy_ns_per_element_for_footprint` answers the beyond-L2 copy
rate past the class's 1 MiB L2 and the row at every other size, and the plan's
rate is the one every scheduling decision asks at: the width of the replay that
is not tiled (`for_len_at_rate`) and both the fork gate and the recursive
splitter of the tiled replay of #422 (`is_parallel_at_rate`,
`mapreduce_threaded_at_rate`). A caller's budget is not narrowed for the tiled
replay, so only the decision to fork changes.

A plan that is one unit-stride run (reversed included) keeps the row at every
footprint: a streamed contiguous copy measures 0.176-0.177 ns per element at 2
and 16 MiB, i.e. the row within 4%. Contiguous callers' widths therefore do not
move, and the row itself is not raised: raising it to 0.500 (the withdrawn head)
also leaves 3.09 / 0.500 = 6.18x of error on the acceptance case.

Acceptance: the plan estimates 3.0 ns per element against the 3.09-3.24 the
512x512 serial case measures on the host of #363 (criterion: a factor of two).
`UpdatePlan`, the gather plans and the plan-free `replay_*_raw` entries keep the
row.

Four tests carry the change, two of them executed (worker installs through
`threadteam`'s ledger for the untiled replay, recorded splitter leaves for the
tiled one) and one per mutation the last review asked for: pinning the rate to
the row fails the two executed tests and the acceptance test, and dropping the
reversed-run exemption fails the reversed one.

`docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md` carries the
measurements, the red-then-green runs, the mutations and the residual (including
what is not calibrated).
@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 3
UNVERIFIED: 1

Critical (must not merge)

none

Needs changes

  • Reversed multidimensional contiguous buffers lose the contiguous-rate exemption — strided-basic/src/copy_plan.rs:301–310. The rank == 1 check relies on fusion collapsing every contiguous run, but strided-basic/src/raw_ops.rs:175 sorts destination strides by their signed values: dimensions [512, 512] with both stride lists [-1, -512] remain rank two, so AVX-512 pricing becomes 3.0 instead of 0.171 ns/element, contradicting the unchanged-contiguous-width claim.

    Reproduce: In an internal unit test on the AVX-512 pricing path, compile CopyPlan::compile(&[512, 512], &[-1, -512], &[-1, -512]) and assert that ns_per_element::<f64, f64>() equals the Copy row; the source trace yields rank two and rate 3.0. These are valid dense reversed views with backing length 262,144 and base offset 262,143. Add this case alongside the rank-one reversed test and correct the sign-sensitive contiguity assumption.

  • The tiled forwarding test accepts a replay that never forks — strided-basic/src/copy_plan/tests/tests.rs:794–799. Testing only !leaves.is_empty() does not establish that the recursive splitter received the plan’s rate: a serial root leaf satisfies that assertion.

    Reproduce: Change only the argument at strided-basic/src/copy_plan.rs:962 to KernelClass::Copy.ns_per_element(), leaving the outer gate at line 935 unchanged, then run cargo test -p strided-basic --lib --features parallel a_strided_plan_past_l2_splits_its_tiled_replay_at_its_own_rate -- --nocapture on AVX-512. The source trace reaches the outer gate, declines the splitter’s fork, and records one leaf at lines 964–967, which still satisfies the test. Assert an actual fork or the expected split-leaf count, and mutate this forwarding argument independently of the outer gate. On non-AVX-512 hosts, lines 751–757 return before exercising either path.

  • The scheduling documentation describes the behavior this PR removes — strided-basic/src/cost.rs:55–58. It says the tiled replay gates forks “on the class,” whereas copy_plan.rs:935 and copy_plan.rs:956–962 pass the plan-specific rate to both gates; tracing a beyond-L2 transpose therefore contradicts the documented policy. Update this description to match the implementation and docs/design/cpu-exec-placement.md.

Unverified claims

  • Measured medians and the “within run-to-run noise” conclusion — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:16–26,94–114. The worklog supplies aggregate tables but does not identify the exact benchmark invocation or provide the underlying samples; cannot read the measurement harness and sample logs from the supplied evidence. In particular, the classification of 0.348 → 0.355 ns/element as noise cannot be established from those two medians. Provide the harness invocation and paired samples for the stated revisions and placement.

Checked and fine

  • strided-perm/ has identical Git tree SHA 08cd3e55f924e33f09d4eced0bfb1a8e0e3d556d at the base and reviewed head.
  • CI run 42584338762 targets c7cdf20d792772427ebf1014ce7251e64fcd54c0; all four feature-lane jobs concluded successfully.
  • Not checked: the reproducers above are source-traced, not executed; the execution attempt returned no test results, and native AVX-512 timings were not rerun.

Reviewed head: c7cdf20d792772427ebf1014ce7251e64fcd54c0 at 2026-11-09T08:19:28Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 2
UNVERIFIED: 2

Critical (must not merge)

none

Needs changes

  • Dense reversed layouts above the inline-rank limit lose the contiguous-rate exemption — strided-basic/src/copy_plan.rs:336–338. Reproduce inside the unit-test module with dims = [4usize; 9] and both stride lists equal to [-1, -4, -16, -64, -256, -1024, -4096, -16384, -65536]: fusion retains nine axes, and is_contiguous_run() unconditionally returns false through the spilled branch. These layouts cover the same dense, reversed 262,144-element buffers as the exempt rank-one layout, but their combined 4 MiB footprint selects 3.0 instead of 0.171 ns/element on AVX-512. This changes scheduling contrary to the unchanged-contiguous-width claim; with a two-slot pool and flat 20 µs dispatch costs, the width rule changes from 1 to 2. The new reversed-dense test at copy_plan/tests/tests.rs:821 covers only the inline representation.

  • The evidence harness labels a clamped 16-slot token as budget 96 — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:361,372–376. The pool has 16 slots, and the pinned threadteam 0.5.1 implementation clamps Exec::new(&pool, 96) to pool.width(), so the printed “width at budget 96” is calculated with budget 16. Reproduce by inserting assert_eq!(exec.budget().get(), 96) immediately after line 372: it receives 16. This output cannot verify the issue’s budget-96 width criterion; print the effective budget or use a separate correctly sized pool.

Unverified claims

  • The quoted Xeon numbers do not establish a two-host calibration of the current tiled replay — strided-basic/src/cost.rs:97–105 and docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:207–209. Verification procedure: inspect KernelClass::Copy rate is 4-19x below the measured cost of strided transposes on a Xeon AVX-512 host, so their width is chosen for a much smaller job #363’s “Versions and host” section, which identifies strided-basic = 0.10.0, then compare it with perf(basic): cache-block the plan and replay copy traversal #422, which subsequently introduced tiled plan replay. The quoted 2.91–3.24 ns/element measurements therefore describe the earlier implementation, not measurements of this tiled implementation on that Xeon. The arithmetic against those historical constants is checkable; the asserted current-path, two-host calibration is not. Cannot read post-perf(basic): cache-block the plan and replay copy traversal #422 Xeon samples supporting that claim.

  • Contended measurements do not establish that 3.0 necessarily under-prices the uncontended untiled layout — strided-basic/src/cost.rs:112–114 and docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:198–203. The appendix’s rank-one stride-256 measurements were taken with a co-tenant on the measured CPU set; even assuming contention only increases elapsed time, a measured value above 3.0 does not establish that the uncontended value exceeds 3.0. Reproduce the missing check with the appendix’s [1024], stride [256] case in an uncontended run before asserting “under-prices … not over.” Cannot read an uncontended measurement for this case in the supplied evidence.

Checked and fine

  • GitHub comparison for supplied head d70b8c6 contains no changes under strided-perm/; CI run 42587985918 completed successfully for that exact head.
  • The PR subsequently advanced to 7aed78d; that newer head was not reviewed here.
  • Not rerun: Rust tests, executable mutations, or hardware benchmarks; the reproducers above are source-traced, with fusion and width arithmetic independently checked.

Reviewed head: d70b8c67b7ac90f840162179d4516791844ffc46 at 2026-11-09T08:45:00Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 2
UNVERIFIED: 2

Critical (must not merge)

none

Needs changes

  • The dense-reversed exemption recognizes a possible traversal, not the traversal replay actually executes — strided-basic/src/copy_plan.rs:318–335,363–364. Reproduce with the new test’s [4; 9] dimensions and strides [-1, -4, …, -65536]: signed-stride sorting leaves -65536 first (raw_ops.rs:175–180), and the spilled replay walks that axis fastest (raw_ops.rs:729–732), visiting relative offsets 0, -65536, -131072, -196608, -16384, …, not consecutive elements. Nevertheless, is_contiguous_run() returns true and selects 0.171 on AVX-512 for this 4 MiB layout, bypassing footprint pricing for an actually strided traversal. The regression at copy_plan/tests/tests.rs:845–853 asserts the classification without executing or examining that traversal. Base the exemption on the replay’s actual order; the claimed single streamed run does not exist in this path.

  • The forwarding regressions become successful no-ops on the documented hosted-runner classes — strided-basic/src/copy_plan/tests/tests.rs:702–708,751–757. Reproduce on AVX2 or Apple by replacing the rate passed from CopyPlan::replay with KernelClass::Copy.ns_per_element(), then running cargo test -p strided-basic --features parallel copy_plan::tests -- --nocapture: both forwarding tests return before execution, the acceptance test still reads the unchanged private estimator, and the host-independent splitter test calls the helper directly rather than the mutated forwarding path. Thus these tests cannot reject that mutation on those hosts, and ordinary successful-test output hides the printed skip. Exercise the forwarding path with a deterministic explicit test rate, or provide an enforced AVX-512 test lane rather than counting these returns as passing coverage.

Unverified claims

  • The budget-96 width acceptance requirement is not established — strided-basic/src/copy_plan/tests/tests.rs:637–665. Issue plan cost: cost a CopyPlan by segments and footprint, not by a flat per-element class rate (#363) #364 requires comparing the selected width against width_for(measured_serial, 1) at budget 96, within one step; the added test checks the transpose’s scalar rate, then compares widths only for a contiguous plan at budget 4. Reproduce the evidence gap by running a_strided_plan_past_l2_prices_itself_above_the_contiguous_row: it contains no measured-duration width comparison for the transposing acceptance case. The PR’s “met” result establishes its stated rate arithmetic, not that scheduling acceptance criterion.

  • Performance of the changed parallel scheduling is unverified — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:225–229,291–365. The supplied harness uses Exec::serial() for every CopyPlan measurement and a parallel token only for strided_perm::copy_into, whose implementation this PR leaves unchanged. Reproduce by following the appendix harness: no timed case exercises CopyPlan with the newly changed parallel width or recursive fork decisions. Those tables therefore cannot establish whether the changed scheduling improves performance or causes a regression; that requires a baseline/head comparison using a parallel CopyPlan.

Checked and fine

none

Not run here: Rust tests, mutation commands, or benchmarks; the reproductions above are source-traced, not execution results.


Reviewed head: 08895fd72477c3ddfd047b06cc228adeea7a8751 at 2026-11-09T09:08:28Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

… forwarding on every host (#364 review)

- `is_contiguous_run` reads the fused axes in replay order (axis 0 fastest).
  A dense reversed buffer of rank two or more is walked with its largest stride
  fastest, because fusion sorts by signed destination stride. It is no longer
  exempt: it is priced as the strided walk it is. The fusion sort itself is
  unchanged.
- `CopyPlan::replay_on(host, ..)` / `ns_per_element_on(host)` make the class
  injectable. The forwarding tests replay at `X86_64Avx512` with a `Generic`
  control instead of returning early on classes without a beyond-L2 rate.
- New `the_contiguous_exemption_is_the_walk_the_replay_takes` records the
  replay's visits and checks the exemption against them. It replaces
  `a_reversed_dense_buffer_keeps_the_copy_row`.
- New `a_transposing_plan_past_l2_asks_for_the_width_of_its_measured_time`
  checks #364's budget-96 criterion against `width_for(measured, 1)` on the
  512 and 1024 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 1
UNVERIFIED: 3

Critical (must not merge)

none

Needs changes

  • The budget-96 acceptance test checks a scheduler that these layouts do not use — strided-basic/src/copy_plan/tests/tests.rs:870–872: planned comes from for_len_at_rate, but the tested transposes take replay_tiled, which passes the original budget to the recursive splitter at strided-basic/src/copy_plan.rs:1008–1020 without applying that width. Reproduction: replay the same 512² and 1024² plans through replay_on(X86_64Avx512, …) with the test’s 96-thread pool and record take_tiled_leaves(); my isolated run produced 96 leaf regions for each, whereas the test’s helper returned 23 and 47. Leaf count is not simultaneous worker count, but this demonstrates that the asserted flat width is not the tiled placement decision. In a second isolated experiment, forcing replay_tiled’s serial branch at line 990 still left a_transposing_plan_past_l2_asks_for_the_width_of_its_measured_time passing. Test the actual tiled scheduling criterion, or rename the test and correct the PR/worklog’s claim that it verifies the replay’s width.

Unverified claims

  • The changed scheduling has no performance validation — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:298–304, :392, :417: every timed CopyPlan invocation uses Exec::serial(), bypassing the fork/width behavior this PR changes. Reproduction: run the appendix harness unchanged; neither its serial plan rows nor its parallel, unchanged strided_perm::copy_into rows compare baseline/head parallel CopyPlan performance. The worklog acknowledges this omission; whether the new scheduling improves or regresses the affected layouts remains unverified.

  • Contaminated timings do not establish that the untiled rate is underpriced — strided-basic/src/cost.rs:116–118 and docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:285–289: the conclusion that 3.0 ns/element underprices the stride-256 layout by 3–4× relies on measurements taken with a co-tenant inside the measured CPU set. Reproduction: inspect the recorded 17:35 rows at worklog lines 341–346; the 9.580/12.656 ns samples have no uncontended control. Even accepting the stated assumption that contention only increases time, an inflated measurement cannot prove that the uncontended time exceeds 3.0. Label the underpricing direction and ratio unverified, or supply an uncontended measurement.

  • The head’s green hosted check provides no Rust verification evidence — .github/workflows/pr-verification.yml:14–16, compared with .github/workflows/ci.yml:75–100 and :136–220. Reproduction: query gh run list --repo tensor4all/strided-rs --commit 5354bb4509b737ae7c9bea90aa36f463f5970006 and inspect run 42596224782; at review time, the only returned run was the successful description-check workflow, whose sole job was body / body. No hosted Rust test, feature-lane, clippy, or rustdoc result appeared for this SHA. The supplied local logs do not establish those hosted results.

Checked and fine

none

Not checked: AVX-512 performance or a fresh full-workspace matrix; the changed scheduler’s performance remains unverified.


Reviewed head: 5354bb4509b737ae7c9bea90aa36f463f5970006 at 2026-11-09T09:48:36Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

… tiled placement (#364 review)

The transposing layouts take the tiled replay, which keeps the caller's budget.
Its splitter records 96 leaves at budget 96 for 512^2 and 1024^2. The test only
compares `for_len_at_rate` at the plan's rate with `width_for(measured, 1)`, so
it is renamed to say that. The worklog now records the tiled placement as not
meeting #364's criterion, and as an open item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 2
UNVERIFIED: 3

Critical (must not merge)

none

Needs changes

  • The actual transposing replay still misses plan cost: cost a CopyPlan by segments and footprint, not by a flat per-element class rate (#363) #364’s scheduling acceptance criterion — strided-basic/src/copy_plan.rs:1011–1018 passes the unrestricted budget to the tiled splitter, whereas strided-basic/src/copy_plan/tests/tests.rs:875–878 tests for_len_at_rate without executing that replay. Reproduction: extend the test to allocate the 512² and 1024² buffers, invoke replay_on(X86_64Avx512, …) with its 96-slot token, and inspect take_tiled_leaves(); the PR’s own recorded result is 96 leaves, versus the measured-time rule’s 24 and 46–47 participants (docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:305–308). Renaming the test makes its claim narrower but does not satisfy the requested placement criterion; either implement and verify that behavior or obtain an explicit acceptance change.

  • The benchmark’s claimed wrong-traversal detector accepts incorrect copies — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:394–413 fills every source element with 1.5 and checks only the first and last destination elements, so ignoring the transpose—or writing only those endpoints—passes its assertions. Reproduction: replace the harness’s plan.execute call with writes of 1.5 to those two destination slots; all assertions still pass and the harness reports a timing despite leaving the interior uncopied. The same defect appears at lines 421–435 and 442–458; use distinguishable source values and validate the complete logical mapping outside the timed region, or remove the claim that these checks detect a wrong traversal.

Unverified claims

  • Performance of the scheduling change is unverified — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:309–315,330–331 confirms that every measured CopyPlan uses Exec::serial(), so those measurements cannot establish whether the changed parallel width, fork gate, or recursive splitting improves or regresses execution. Verification needed: compare baseline and head on an AVX-512 host with explicit parallel tokens for both tiled and untiled layouts; benchmarking the unchanged permutation engine does not exercise these changes.

  • The untiled “under-prices … not over” conclusion is not established — strided-basic/src/cost.rs:112–114 draws that conclusion from a 9.8 ns/element measurement taken with a co-tenant, while docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:355–357 assumes interference can only increase elapsed time. Even granting that assumption, an inflated observation above 3.0 does not prove the uncontended value exceeds 3.0. Verification needed: rerun [1024] with stride [256] under uncontended placement, or retain the observation without asserting the direction or ratio of pricing error.

  • Hosted test coverage of the submitted head is unverified — .github/workflows/pr-verification.yml:15–16 invokes the description-verification workflow, not the Rust test matrix; querying check runs for d176872543f33778c23a8ec5f504a4e917a95af9 returned only successful body / body, while Rust checks were attached to 5354bb4. Reproduction: run gh api repos/tensor4all/strided-rs/commits/d176872543f33778c23a8ec5f504a4e917a95af9/check-runs; the current green description check is not evidence that the submitted head passed compilation or tests.

Checked and fine

  • git diff b2358fb HEAD -- strided-perm is empty.
  • The existing local test binary ran 33 copy_plan::tests tests with zero failures; it was not rebuilt.

Validation limit: no source rebuild, fresh mutation run, or hardware performance measurement was performed.


Reviewed head: d176872543f33778c23a8ec5f504a4e917a95af9 at 2026-11-09T09:59:43Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

shinaoka and others added 6 commits November 9, 2026 19:21
`CopyPlan` priced every copy at the `Copy` row (0.171 ns per element on
`x86_64-avx512`), which is the L2-resident contiguous rate. A working set past
the class's L2 cache whose traversal touches a new cache line per element pays
about 3.0 ns per element there, so the row under-priced a 512x512 transposing
copy by 6-19x and the width rule picked a width for a job that much smaller.

`compile` now records the span of each side, and the plan forms its footprint in
bytes at replay, each side at its own element size (the one fact `compile`
cannot know), so this stays a compile-time plan property with no probing. The
crate-internal `copy_ns_per_element_for_footprint` answers the beyond-L2 copy
rate past the class's 1 MiB L2 and the row at every other size, and the plan's
rate is the one every scheduling decision asks at: the width of the replay that
is not tiled (`for_len_at_rate`) and both the fork gate and the recursive
splitter of the tiled replay of #422 (`is_parallel_at_rate`,
`mapreduce_threaded_at_rate`). A caller's budget is not narrowed for the tiled
replay, so only the decision to fork changes.

A plan that is one unit-stride run (reversed included) keeps the row at every
footprint: a streamed contiguous copy measures 0.176-0.177 ns per element at 2
and 16 MiB, i.e. the row within 4%. Contiguous callers' widths therefore do not
move, and the row itself is not raised: raising it to 0.500 (the withdrawn head)
also leaves 3.09 / 0.500 = 6.18x of error on the acceptance case.

Acceptance: the plan estimates 3.0 ns per element against the 3.09-3.24 the
512x512 serial case measures on the host of #363 (criterion: a factor of two).
`UpdatePlan`, the gather plans and the plan-free `replay_*_raw` entries keep the
row.

Four tests carry the change, two of them executed (worker installs through
`threadteam`'s ledger for the untiled replay, recorded splitter leaves for the
tiled one) and one per mutation the last review asked for: pinning the rate to
the row fails the two executed tests and the acceptance test, and dropping the
reversed-run exemption fails the reversed one.

`docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md` carries the
measurements, the red-then-green runs, the mutations and the residual (including
what is not calibrated).
… forwarding on every host (#364 review)

- `is_contiguous_run` reads the fused axes in replay order (axis 0 fastest).
  A dense reversed buffer of rank two or more is walked with its largest stride
  fastest, because fusion sorts by signed destination stride. It is no longer
  exempt: it is priced as the strided walk it is. The fusion sort itself is
  unchanged.
- `CopyPlan::replay_on(host, ..)` / `ns_per_element_on(host)` make the class
  injectable. The forwarding tests replay at `X86_64Avx512` with a `Generic`
  control instead of returning early on classes without a beyond-L2 rate.
- New `the_contiguous_exemption_is_the_walk_the_replay_takes` records the
  replay's visits and checks the exemption against them. It replaces
  `a_reversed_dense_buffer_keeps_the_copy_row`.
- New `a_transposing_plan_past_l2_asks_for_the_width_of_its_measured_time`
  checks #364's budget-96 criterion against `width_for(measured, 1)` on the
  512 and 1024 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tiled placement (#364 review)

The transposing layouts take the tiled replay, which keeps the caller's budget.
Its splitter records 96 leaves at budget 96 for 512^2 and 1024^2. The test only
compares `for_len_at_rate` at the plan's rate with `width_for(measured, 1)`, so
it is renamed to say that. The worklog now records the tiled placement as not
meeting #364's criterion, and as an open item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e what the harness checks

- `a_transposing_plan_rate_past_l2_gives_the_width_of_its_measured_time` now
  replays both rows against the 96-slot token and records the splitter's leaves:
  96 for both, i.e. the tiled placement asks for the budget, not for the width
  its rate wants. That gap is strided-rs#430; the test's doc says so instead of
  claiming the criterion on the tiled path.
- The benchmark section of the worklog claimed its two endpoint asserts would
  catch a wrong traversal; a constant 1.5 fill passes a copy that skips the
  interior or ignores the transpose. The claim is removed and the residual says
  correctness is carried by the unit tests.
- The untiled extreme (rank-1, stride 256) is 9.6-12.7 ns per element under a
  co-tenant; the 'under-prices, not over' direction is withdrawn because a
  contended sample cannot establish the uncontended value.
The branch was rebased onto main so that #429's spilled-traversal tiling and the
plan's own rate meet in one replay: the tiles now come from
PairTraversal::tiles, and the rate the untiled replay prices itself at is
threaded through the inline, spilled-inline and spilled-raw arms.
@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 2
UNVERIFIED: 1

Critical (must not merge)

none

Needs changes

  • Spilled tiled copies discard the plan’s rate — strided-basic/src/copy_plan.rs:867–868 does not forward ns_per_element to replay_spilled_tiled, whose outer gate at :1099 and recursive splitter at :1120–1126 still use KernelClass::Copy, leaving this path priced at the old row despite the “every scheduling decision” claim.
    Reproduction: Compile dimensions [4; 9], destination strides 4^axis, and source strides 4^(8-axis) for f64; this is the spilled tiled layout already exercised by strided-basic/src/raw_ops/tests/tiled_tests.rs:323–342. In an internal test, replay through replay_on(X86_64Avx512, …) using four slots and WidthCosts::flat(100 µs) for all dispatch kinds. The plan estimates 786.432 µs, which pays the 300 µs fork, but the spilled gate uses at most 44.827 µs and stays serial. Assert worker installation to expose the dropped rate. This reproducer is source-traced, not executed. Forward the rate through both spilled scheduling decisions and add executed coverage for this branch.

  • The supplied benchmark harness cannot parse — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:413–421 closes the if rep >= 4 block but omits the closing brace of the repetition loop, preventing the advertised harness from being rebuilt.
    Reproduction: Extract the fenced Rust block into repro424.rs, then run rustfmt --edition 2021 --emit stdout repro424.rs. I executed the equivalent stdin command; it exited 1 with “this file contains an unclosed delimiter”, pointing to fn plan_case. Restore the missing brace and compile-check the exact published harness.

Unverified claims

  • The underpricing bound is still asserted without uncontended evidence — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:318–320 says the rate is “3.2–4.2x low” against the rank-one measurements, although :295–298 explicitly says those co-tenant samples cannot establish an uncontended value or a direction/ratio. Reproduce the arithmetic with 9.6 / 3.0 and 12.7 / 3.0: it establishes ratios to contaminated observations, not an uncontended underpricing bound. The same sentence also includes the pre-tiling 7.2–9.7 range, whose ratios are 2.4–3.23, not 3.2–4.2. Remove the bound or provide an uncontended measurement.

Checked and fine

  • git diff origin/main...a2a28f1 -- strided-perm/ returned no changes.
  • CI run 42600691302 targets a2a28f1; workspace-test and feature-lane jobs had succeeded, but the Ubuntu runtime-SIMD check was still running at inspection.

Not checked: full local gates and parallel-performance comparisons; local kache doctor --verify timed out before completing.
Remaining risk: spilled tiled plans can silently retain the old scheduling estimate.


Reviewed head: a2a28f1a40370b57a7704da4b900f0bdac7864cb at 2026-11-09T10:24:48Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

…r the published harness (#364 review)

- `replay_spilled_tiled` gated at the `Copy` row: a rank-above-inline plan whose
  tiles the model applies to the compressed axes forked on the inline path and
  stayed serial on the spilled one. Its outer gate and its splitter now take
  `ns_per_element` like the inline path. The rate is threaded from
  `replay_fused`'s spilled arm.
- `a_spilled_tiled_plan_past_l2_prices_its_splitter_at_its_own_rate` (dims [4;9],
  dst strides ascending powers of four, src reversed) installs a worker at the
  plan rate and none when priced for a class without a beyond-L2 rate. Reverting
  the gate to `is_parallel(KernelClass::Copy, ..)` fails it ('the spilled
  splitter did not fork').
- The worklog's harness snippet lost the brace that closes `plan_case`'s
  repetition loop during the previous edit; `rustfmt --emit stdout` now parses
  the fenced block. The residual no longer asserts an underpricing ratio from
  co-tenant samples.
@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 2
UNVERIFIED: 1

Critical (must not merge)

none

Needs changes

  • The measurements do not exercise the scheduling being changed — strided-basic/src/copy_plan.rs:1014,1037-1044,1107,1128-1135; docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:311-318,411,436. Both CopyPlan timing functions pass Exec::serial(), so rerunning the published harness cannot establish whether the new fork gates and recursive splitting improve or regress parallel execution; the parallel copy_into measurements exercise the unchanged engine instead. The repository’s performance-evidence requirement remains unmet despite the disclosure. Compare baseline and head through public CopyPlan::execute on an AVX-512 host at one and four threads, including tiled and untiled layouts, with verified thread counts and full output validation outside timing.

  • The new rustdoc link names a nonexistent method — strided-basic/src/copy_plan.rs:817. Run RUSTDOCFLAGS='-D warnings' cargo doc -j 4 -p strided-basic --no-deps --document-private-items: rustdoc reports unresolved link to CopyPlan::ns_per_element, because the implemented method is ns_per_element_on. Fix the link; the ordinary public-documentation gate does not cover this private item. This command also reports unrelated, pre-existing documentation errors; those are not attributed to this PR.

Unverified claims

  • The quoted full-verification results do not establish verification of submitted head 2284ea1 — .github/workflows/CI.yml:86-100; strided-basic/src/copy_plan.rs:1096-1135. The body identifies earlier heads for its local gates, while the submitted head additionally changes the spilled tiled replay. At inspection, CI run 42602179930 matched 2284ea173f2fd3d6a5093748d6d4c2dc3b257dbe, but cargo test (ubuntu-latest) remained in progress; its subsequent overhead and SIMD steps were still pending. Reproduce with gh run view 42602179930 --repo tensor4all/strided-rs --json headSha,status,conclusion,jobs. The quoted local logs cannot be read from the supplied artifacts, so their counts were not independently verified.

Checked and fine

  • At 2284ea1, cargo test -j 4 -p strided-basic --features parallel --lib copy_plan::tests -- --test-threads=1: 34 passed.
  • git diff origin/main HEAD -- strided-perm was empty; the budget-96 test also passed with its explicit 96-leaf assertion.
  • Not rerun: AVX-512 benchmarks or full workspace gates; parallel performance remains unverified.

Reviewed head: 2284ea173f2fd3d6a5093748d6d4c2dc3b257dbe at 2026-11-09T10:37:23Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

Parallel CopyPlan measurement on an AVX-512 host (review request: baseline vs head through the
public API, 1 and 4 threads, tiled and untiled, output checked outside the clock).

Host: EVO-X2, AMD RYZEN AI MAX+ 395 (Zen 5, AVX-512), 32 threads, Linux. Measured set
taskset -c 0-3 (1t) and 0-7 (4t). Load average 3.3-3.7 throughout (5 users on the box), so
single-digit percentage differences are not resolved; the numbers below are medians of 41
repetitions after 4 warmups, three runs per tree.

Harness (committed to neither tree; strided-basic/examples/bench424.rs):

let plan = CopyPlan::compile(dims, dst_strides, src_strides).unwrap();
for rep in 0..45 {
    let src_ref = RawStridedRef::new(&src, dims, src_strides, 0).unwrap();
    let mut dst_mut = RawStridedMut::new(&mut dst, dims, dst_strides, 0).unwrap();
    let start = Instant::now();
    plan.execute(&mut dst_mut, &src_ref, exec.reborrow()).unwrap();
    let elapsed = start.elapsed();
    if rep >= 4 { samples.push(elapsed.as_secs_f64() * 1e9 / total as f64); }
}
// outside the clock: every logical element against the strided oracle, with src[i] = i + 0.5

exec is Exec::serial() at 1t and Exec::new(&pool, 4) over a 4-thread pool at 4t; every run
of both trees passed the full-output check.

cell base edcf71f head 2284ea1 ratio
1t, 512x512 transposing, tiled 2.290 / 2.396 / 2.398 2.400 / 2.401 / 2.412 1.01-1.05
4t, 512x512 transposing, tiled 0.585 / 0.602 / 0.613 0.599 / 0.605 / 0.609 0.99-1.02
1t, rank-1 stride 256, untiled 9.45 / 9.76 / 9.99 9.73 / 9.79 / 9.81 0.98-1.03
4t, rank-1 stride 256, untiled 9.64 / 9.77 / 9.99 9.85 / 9.90 / 9.96 0.99-1.03

The 1t tiled row is where the largest ratio appears, and the base's own spread (2.290-2.398,
4.7%) is as wide as the gap to head, so it does not establish a regression. What the run does
establish: the scheduling change does not move either cell by more than the host's noise, and
the untiled cell is unchanged, which is what pricing the untiled replay at 3.0 predicts (it stays
serial at 4 slots, as it does on main).

Residual: not a quiet-host measurement (load 3.3-3.7 from other users), and a 4-slot budget
cannot show whether the tiled splitter's new rate gate helps at 8+ slots; #364's Xeon 9242
table is the only quiet AVX-512 data available and it does not carry a parallel CopyPlan row.

@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 2
UNVERIFIED: 2

Critical (must not merge)

none

Needs changes

  • The executed acceptance path still bypasses the width being validated — strided-basic/src/copy_plan.rs:1037–1044 passes the unnarrowed token to the tiled splitter, while strided-basic/src/copy_plan/tests/tests.rs:922–925 explicitly requires 96 leaves instead of checking plan cost: cost a CopyPlan by segments and footprint, not by a flat per-element class rate (#363) #364’s width criterion.

  • The new documentation contains an unresolved method link — strided-basic/src/copy_plan.rs:817 references CopyPlan::ns_per_element, but the method defined at line 357 is ns_per_element_on.

    • Reproduce at reviewed head 2284ea1:
      RUSTDOCFLAGS="-D warnings" cargo doc --offline \
        -p strided-basic --no-deps --document-private-items
      The observed diagnostic is unresolved link to CopyPlan::ns_per_element, reporting that CopyPlan has no such associated item.
    • Replace the link target with CopyPlan::ns_per_element_on. The normal documentation gate passes because it does not document this private item; that green result does not validate this link.

Unverified claims

  • Parallel performance of the scheduling change remains unverified — docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:311–317 records the missing comparison, and the timed call at line 411 uses Exec::serial(), which cannot exercise the changed parallel width or fork decisions.

    • Reproduce the evidence gap: Run the appendix harness unchanged: every timed CopyPlan call remains serial, while its parallel timings belong to the unchanged permutation engine. A baseline/head comparison using pooled CopyPlan::execute on an AVX-512 host is needed to establish whether the new scheduling improves or regresses those cases. No regression magnitude is established by the supplied numbers.
  • Complete current-head CI success was not established at inspection time — .github/workflows/ci.yml:98–100 runs the runtime SIMD dispatch check, which was still in_progress in job 129109092427 of run 42602179930, attached to exact head 2284ea173f2fd3d6a5093748d6d4c2dc3b257dbe.

    • Reproduce: Query that job with gh api repos/tensor4all/strided-rs/actions/jobs/129109092427. Its test and overhead steps had succeeded, but the job had no final conclusion; cannot read the unfinished job’s full log through gh run view --log. The PR’s earlier local counts do not establish this final gate’s outcome.

Checked and fine

strided-perm/ has no diff between the PR base edcf71f and reviewed head 2284ea1.

Not checked: native AVX-512 parallel timings; scheduling performance remains unverified. The local test rerun was not completed within the verification worker’s budget.


Reviewed head: 2284ea173f2fd3d6a5093748d6d4c2dc3b257dbe at 2026-11-09T10:39:31Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

@shinaoka

shinaoka commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1-sol adversarial review

CRITICAL: none
NEEDS_CHANGES: 0
UNVERIFIED: 2

Critical (must not merge)

none

Needs changes

none

Unverified claims

  • The changed parallel scheduling has no performance evidence — strided-basic/src/copy_plan.rs:949, :1016, :1128; docs/worklogs/2026-11-09-issue-364-copy-plan-footprint.md:311–317. The new rate changes untiled widths and tiled fork decisions, but the supplied timings do not exercise those changes. Reproduce the coverage gap by running the appendix harness: both plan_case and plan_layout_case execute CopyPlan with Exec::serial(); the parallel measurements execute the unchanged strided_perm::copy_into engine. Consequently, those timings cannot exclude a regression from the approximately 17.54× increase in the scheduling estimate (3.0 / 0.171). A paired baseline/head run on native AVX-512, with explicit one-thread and parallel configurations covering untiled, inline-tiled and spilled-tiled plans, remains missing. The PR acknowledges this omission; it remains unverified.

  • The quoted local verification does not establish verification of the submitted head — strided-basic/src/copy_plan.rs:1107–1137, strided-basic/src/copy_plan/tests/tests.rs:1127–1203; PR body, “Verification.” The body cites runs on 5354bb4 and d176872, whereas the submitted head is f893cab; the later spilled-path forwarding and its regression test are therefore not covered by those quoted runs. The history paragraph is also stale: the current ancestry contains merge commit a2a28f1, despite “no merge commit.” Reproduce with git show -s --format='%H %P' a2a28f1 and inspect check runs for f893cabd4fe32503e5020ae59d8ee7c5ab3f520e. At my last query, that head’s Ubuntu cargo test job was still in progress; the parallel feature lanes had completed successfully. I cannot read the retained local logs because their locations are not supplied.

Checked and fine

git diff b2358fb HEAD -- strided-perm is empty; the byte-identical claim holds for that subtree.
The 96-leaf tiled-placement gap is explicitly recorded in the test and #430, not established as meeting #364’s width criterion.
Not checked locally: builds, tests or hardware timings; kache doctor --verify timed out.


Reviewed head: f893cabd4fe32503e5020ae59d8ee7c5ab3f520e at 2026-11-09T10:47:32Z. This review is valid only for that commit: if the head has moved, it is a review of a tree that is not being merged.
Automated (gpt_review.sh). This is an enumeration of counterexamples, not a verdict; the merge decision stays with a human.

@shinaoka
shinaoka merged commit 3562e01 into main Nov 9, 2026
20 checks passed
@shinaoka
shinaoka deleted the fix/363-copy-rate branch November 9, 2026 10:56
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.

1 participant