Repository navigation
Wrap incremental slicing results as ASV samples and restore the existing reducer - #207
Merged
Merged
Conversation
… 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
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
approved these changes
Oct 7, 2026
Contributor
Thanks @CodyCBakerPhD . That makes sense. Thanks for fixing that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Targets
add_time_slicing_benchmark. With the incremental slicing benchmark returning its results the way the other tracking benchmarks do, most of thereduce_resultsrewrite on that branch is no longer needed.AI Summary
Why
track_cumulative_slice_timesreturned a plain dict. ASV 0.6.1 stores that in theresultcolumn with nosamples. 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.track_benchmarks (network tracking) returndict(samples=..., number=None).--record-samplesflag thatnwb_benchmarks runalways passes, ASV then writes the dict to thesamplescolumn.Changes
track_incremental_slicing.py:track_cumulative_slice_timesreturnsdict(samples={"cumulative_time_in_seconds": [...]}, number=None).setup/_reduce_results.py: back to the version onmain, with one fix.null), the other parameter sets of that benchmark were dropped too, with a length-mismatch warning.database/_models.py:parse_parameter_caseno longer special-cases(). Only benchmarks with no parameters produce that, and the suite has none.normalize_time_and_network_resultsstays. Without it, the database reader treats every dict result as network statistics and raises aKeyErroron these results.reduce_resultsitself 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, atime_benchmark with one parameter set not selected, and an unwrappedtrack_benchmark.track_cumulative_slice_timesreturns the wrapped form.Net change against the base branch: +173 / −203.
_reduce_results.pyalone goes from +89/−34 againstmainto +17/−20.How it was checked
blackandisortpass.main's reducer before the fix, 4 reducer tests fail.HDF5PyNWBLocalIncrementalSliceBenchmarkran throughasv run --python=same --record-sampleson a synthetic local icephys file, withRUN_INCREMENTAL_SLICING_BENCHMARKS=icephys.reduce_resultskept the 7 cumulative times.nwb_benchmarks.database.Resultsloaded them as 7 increasingcumulative_time_in_secondsrows.🤖 Generated with Claude Code
https://claude.ai/code/session_015K2S7gEkSTfhpnfbXVD5YG
Generated by Claude Code