Skip to content

Return incremental slicing timings as ASV samples instead of rewriting the reducer - #206

Closed
CodyCBakerPhD wants to merge 1 commit into
add_time_slicing_benchmarkfrom
claude/bold-volta-rzyanr
Closed

CodyCBakerPhD wants to merge 1 commit into
add_time_slicing_benchmarkfrom
claude/bold-volta-rzyanr

Conversation

@CodyCBakerPhD

Copy link
Copy Markdown
Collaborator

Stacked on add_time_slicing_benchmark. Proposes a smaller alternative to that branch's reduce_results rewrite.

Why

track_cumulative_slice_times returns 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 current reducer skips it.

The network tracking benchmarks already handle this by returning dict(samples=..., number=None) (NetworkTracker.asv_network_statistics). With the --record-samples flag that nwb_benchmarks run always passes, ASV then writes the dict to the samples column, and the existing reducer reads it without changes.

Every file written by asv==0.6.1 includes result_columns, so the "older layout" branch in the rewrite never runs on files from the pinned version.

Changes

  • track_incremental_slicing.py: track_cumulative_slice_times now returns dict(samples=timings, number=None).
  • _reduce_results.py: goes back to main's version with one fix the rewrite did get right. When one parameter set fails (its samples are null), the other parameter sets of that benchmark are now kept. Previously the whole benchmark was dropped with a length-mismatch warning. That warning now fires only when the parameter, result and samples lists have different lengths.
  • The _models.py, params.py and docs changes on the base branch are untouched.

Net change against the base branch: +36 / −91.

How it was checked

All runs used asv==0.6.1 locally.

  • Toy suite with a plain-dict track_, a samples-dict track_, a skipped track_, a track_ where one parameter set fails, and a time_ control:
    • With --record-samples, the samples-dict row has 12 entries and holds the timings, the same as the network benchmarks. The plain-dict row has 5 entries.
    • The reducer on this branch gives the same output as the base branch's rewrite for every benchmark except the plain-dict one, which no benchmark returns any more. That includes a --bench pattern selecting only some parameter sets (NaN) and a failed parameter set (null).
    • Skipped benchmarks don't appear in the results file at all.
  • End to end with the real class:
    • 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 get_https_url and get_asset_path_from_url were stubbed in a throwaway suite.
    • The real reduce_results turned that run into the usual {params: {"cumulative_slice_000": ..., ...}} shape at DATABASE_VERSION 4.0.0.
    • nwb_benchmarks.database.Results.safe_load_from_json(...).to_dataframe() returned one row per cumulative step, with parameter_case_slice_strategy filled in.
  • black and isort pass on both changed files.

🤖 Generated with Claude Code

https://claude.ai/code/session_015K2S7gEkSTfhpnfbXVD5YG


Generated by Claude Code

…reducer

`track_cumulative_slice_times` returned a plain dict, which ASV stores in
the `result` column without `samples`, so the row is too short for
`reduce_results` and was dropped. Returning `dict(samples=..., number=None)`,
as the network tracking benchmarks already do, makes ASV write the timings
to the `samples` column (with the `--record-samples` flag `nwb_benchmarks run`
always passes), and the existing reducer handles them unchanged.

That replaces the reducer rewrite with one fix it does need: 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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants