Repository navigation
Convert VectorOfVectors outputs in the first block too - #227
Closed
ggmarshall wants to merge 1 commit into
Closed
ggmarshall wants to merge 1 commit into
ggmarshall wants to merge 1 commit into
Conversation
LGDOVectorOfVectorsIOManager now creates its buffer lazily, in the first write(). When the output unit differs from the variable's (e.g. sample index -> ns), get_buffer appends a UnitConversionManager to the chain at that point, after the block's processors have already run, so the first block is written from an unfilled buffer (zeros). Run any conversion get_buffer added for the block in flight. Assisted-by: Generative AI
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Copilot review overview
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Adds a regression test and a processing-chain fix to ensure VectorOfVectors (VoV) outputs are unit-converted for the first processed block as well as subsequent blocks.
Changes:
- Add a test that reproduces missing unit conversion for the first VoV block output.
- Ensure any unit-conversion processors appended by
get_buffer()are executed for the first block.
| File | Description |
|---|---|
tests/test_processing_chain.py |
Adds a regression test validating first-block VoV unit conversion. |
src/dspeed/processing_chain.py |
Executes conversion processors appended by get_buffer() so the first block is converted. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #227 +/- ##
==========================================
+ Coverage 69.07% 69.13% +0.05%
==========================================
Files 62 62
Lines 4188 4192 +4
==========================================
+ Hits 2893 2898 +5
+ Misses 1295 1294 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
|
Better solution to bug in #228 |
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.


Problem
Since #213,
LGDOVectorOfVectorsIOManagercreates its buffer lazily in the firstwrite(). If the output's unit differs from the variable's (e.g. a timepoint found in sample index and written inns),get_bufferadds aUnitConversionManagerto the chain at that point. By then the first block's processors have already run, so the first block is written from an unfilled buffer.Result: the first
block_widthentries of every chain come out as 0, while the vector lengths are still correct. In LEGEND's SiPM chain this hitstrigger_posandtrigger_pos_dplms. 2.2.0 got the buffer in__init__and is not affected.Fix
In
write(), after the lazyget_buffer, run any processor managers it appended, so the block in flight is converted too. Later blocks are unchanged: the conversion is already in_proc_managers.Tests
test_vov_output_unit_conversion_first_block: 10 entries withblock_width=4andtp_maxin ns. It fails onmain(first 4 entries are 0) and passes with the fix.trigger_posandtrigger_pos_dplmsmatch dspeed 2.2.0 output exactly; without the fix, 15 and 7 traces differ.This PR was prepared with AI assistance (Claude Code) and reviewed by me.
🤖 Generated with Claude Code