Skip to content

Wrap incremental slicing results as ASV samples and restore the existing reducer - #207

Merged
oruebel merged 1 commit into
add_time_slicing_benchmarkfrom
claude/bold-volta-rzyanr
Oct 7, 2026
Merged

oruebel merged 1 commit into
add_time_slicing_benchmarkfrom
claude/bold-volta-rzyanr

Conversation

@CodyCBakerPhD

@CodyCBakerPhD CodyCBakerPhD commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Targets add_time_slicing_benchmark. With the incremental slicing benchmark returning its results the way the other tracking benchmarks do, most of the reduce_results rewrite on that branch is no longer needed.

AI Summary

Why

  • track_cumulative_slice_times returned a plain dict. ASV 0.6.1 stores that in the result column with no samples. It also removes empty trailing columns from each row, so the row ends up with 5 entries instead of 12, and the existing reducer skips it. That was the only reason for the rewrite.
  • All 31 other track_ benchmarks (network tracking) return dict(samples=..., number=None).
    • With the --record-samples flag that nwb_benchmarks run always passes, ASV then writes the dict to the samples column.
    • The existing reducer copies that value through as is, so it works with the list of cumulative times unchanged.

Changes

  • track_incremental_slicing.py: track_cumulative_slice_times returns dict(samples={"cumulative_time_in_seconds": [...]}, number=None).
  • setup/_reduce_results.py: back to the version on main, with one fix.
    • Previously, if one parameter set failed (its samples are null), the other parameter sets of that benchmark were dropped too, with a length-mismatch warning.
    • Now the parameter sets that succeeded are kept. That matters here: an ophys run hitting the 12-hour timeout would otherwise also discard the ecephys and icephys results.
    • The warning now fires only when the parameter, result and samples lists have different lengths.
  • database/_models.py: parse_parameter_case no longer special-cases (). Only benchmarks with no parameters produce that, and the suite has none.
    • The guard in normalize_time_and_network_results stays. Without it, the database reader treats every dict result as network statistics and raises a KeyError on these results.
  • Tests:
    • The reducer tests now run reduce_results itself on a raw results file regenerated with ASV 0.6.1. The file holds the wrapped incremental result (one parameter set fails), a network benchmark, a time_ benchmark with one parameter set not selected, and an unwrapped track_ benchmark.
    • A new test checks that track_cumulative_slice_times returns the wrapped form.

Net change against the base branch: +173 / −203. _reduce_results.py alone goes from +89/−34 against main to +17/−20.

How it was checked

  • Unit tests: 40 pass locally; black and isort pass.
    • With main's reducer before the fix, 4 reducer tests fail.
    • With the base branch's unwrapped return, the new wrapping test fails.
  • End to end:
    • HDF5PyNWBLocalIncrementalSliceBenchmark ran through asv run --python=same --record-samples on a synthetic local icephys file, with RUN_INCREMENTAL_SLICING_BENCHMARKS=icephys.
    • The DANDI API is blocked in the sandbox, so its two lookups were stubbed in a throwaway suite.
    • ASV wrote a 12-entry row. reduce_results kept the 7 cumulative times. nwb_benchmarks.database.Results loaded them as 7 increasing cumulative_time_in_seconds rows.

🤖 Generated with Claude Code

https://claude.ai/code/session_015K2S7gEkSTfhpnfbXVD5YG


Generated by Claude Code

… reducer

`track_cumulative_slice_times` now returns `dict(samples=..., number=None)`,
like the network tracking benchmarks. With the `--record-samples` flag
`nwb_benchmarks run` always passes, ASV then writes the cumulative times
to the samples column, which the existing `reduce_results` reads, so the
reducer rewrite is no longer needed:

- `_reduce_results.py` is back to its version on `main`, with one fix: a
  parameter set that failed (`null` samples) no longer drops the
  successful parameter sets of the same benchmark through the
  length-mismatch warning. The warning now covers only a structural
  mismatch between the parameter, result and samples lists.
- `parse_parameter_case` no longer special-cases `()`, which only
  zero-parameter benchmarks produce and the suite has none of.
- The guard in `normalize_time_and_network_results` stays: the database
  reader still treats every dict result as network statistics otherwise.

The reducer tests now run `reduce_results` on a raw results file
regenerated with asv 0.6.1, holding the wrapped incremental result, a
network, a time, and an unwrapped `track_` benchmark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K2S7gEkSTfhpnfbXVD5YG
@CodyCBakerPhD CodyCBakerPhD self-assigned this Oct 7, 2026
@CodyCBakerPhD
CodyCBakerPhD requested a review from oruebel October 7, 2026 05:27
@CodyCBakerPhD
CodyCBakerPhD marked this pull request as ready for review October 7, 2026 05:27
@CodyCBakerPhD

Copy link
Copy Markdown
Collaborator Author

@oruebel So basically, if we make the output of the new proposed test match the style of the others, then we don't need to adjust the results parser at all

@oruebel

oruebel commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

So basically, if we make the output of the new proposed test match the style of the others, then we don't need to adjust the results parser at all

Thanks @CodyCBakerPhD . That makes sense. Thanks for fixing that.

@oruebel
oruebel merged commit 5a0482d into add_time_slicing_benchmark Oct 7, 2026
3 checks passed
@oruebel
oruebel deleted the claude/bold-volta-rzyanr branch October 7, 2026 07:08
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.

3 participants