Repository navigation
Return incremental slicing timings as ASV samples instead of rewriting the reducer - #206
Closed
CodyCBakerPhD wants to merge 1 commit into
Closed
CodyCBakerPhD wants to merge 1 commit into
CodyCBakerPhD wants to merge 1 commit into
Conversation
…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
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.
Stacked on
add_time_slicing_benchmark. Proposes a smaller alternative to that branch'sreduce_resultsrewrite.Why
track_cumulative_slice_timesreturns 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 current reducer skips it.The network tracking benchmarks already handle this by returning
dict(samples=..., number=None)(NetworkTracker.asv_network_statistics). With the--record-samplesflag thatnwb_benchmarks runalways passes, ASV then writes the dict to thesamplescolumn, and the existing reducer reads it without changes.Every file written by
asv==0.6.1includesresult_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_timesnow returnsdict(samples=timings, number=None)._reduce_results.py: goes back tomain's version with one fix the rewrite did get right. When one parameter set fails (its samples arenull), 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._models.py,params.pyand 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.1locally.track_, a samples-dicttrack_, a skippedtrack_, atrack_where one parameter set fails, and atime_control:--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.--benchpattern selecting only some parameter sets (NaN) and a failed parameter set (null).HDF5PyNWBLocalIncrementalSliceBenchmarkran throughasv run --python=same --record-sampleson a synthetic local icephys file, withRUN_INCREMENTAL_SLICING_BENCHMARKS=icephys.get_https_urlandget_asset_path_from_urlwere stubbed in a throwaway suite.reduce_resultsturned that run into the usual{params: {"cumulative_slice_000": ..., ...}}shape atDATABASE_VERSION4.0.0.nwb_benchmarks.database.Results.safe_load_from_json(...).to_dataframe()returned one row per cumulative step, withparameter_case_slice_strategyfilled in.blackandisortpass on both changed files.🤖 Generated with Claude Code
https://claude.ai/code/session_015K2S7gEkSTfhpnfbXVD5YG
Generated by Claude Code