Repository navigation
Conversation
AI assistance: OpenAI Codex was used for investigation, implementation, regression tests, and automated validation.
| # Time carried across interval boundaries has already been recorded. | ||
| pending_time = 0.0 | ||
|
|
||
| for frame_info_stack, time in frame_records: | ||
| accumulated_time += time | ||
| pending_time += time | ||
|
|
||
| if accumulated_time >= interval: | ||
| result.append((frame_info_stack, accumulated_time)) | ||
| result.append((frame_info_stack, pending_time)) | ||
| pending_time = 0.0 | ||
| accumulated_time = accumulated_time % interval | ||
|
|
||
| if pending_time: | ||
| result.append((frame_records[-1][0], pending_time)) | ||
|
|
There was a problem hiding this comment.
I agree that it looks like the remainder is being double-counted here. I think I'd prefer if the time persisted in result was the floor-rounded accumulated time rather than a value that looks precise but is 'lying' about its precision. also it would use one less local var.
There was a problem hiding this comment.
Updated in f3bf2e7 to floor-rounded whole intervals with one accumulator. The remainder is carried forward and the final partial interval is omitted, matching the requested precision. Regression tests now assert quantization and bounded total error. All 159 local tests and nine hooks pass; hosted CI initially passed 21/23 jobs, with two unchanged CLI sampling failures.
Follow maintainer feedback: emit only whole sampling intervals with one accumulator, carry the remainder forward, and omit a final partial interval. Replace exact-preservation assertions with quantization and bounded-error regressions. Validated on CPython 3.12/Linux: all 159 tests across both required modes; nine pinned hooks; docs; wheel and sdist; strict Twine checks. AI assistance: OpenAI Codex.
| Durations are rounded down to whole intervals, carrying the remainder | ||
| forward. A final partial interval is discarded. |
There was a problem hiding this comment.
this would be better as a comment rather than a docstring.
There was a problem hiding this comment.
Moved the explanation from the docstring to a comment above the resampling loop in 7fcb9ea. All 159 local tests across the two required test modes and all nine hooks pass.
AI assistance: OpenAI Codex.
Resampling double-counts the carried remainder: four 6 ms records at a 10 ms interval report 26 ms from 24 ms of input. Following maintainer feedback, emit whole-interval durations with one accumulator and carry the remainder forward. The final partial interval is intentionally omitted, so this example emits 10 + 10 ms. This replaces the initial exact-duration-preservation approach. Sample-selection positions, inputs and session metadata remain unchanged.
Local validation on CPython 3.12/Linux: all 159 tests across the two required modes (152 ordinary + 7 IPython), all nine pinned hooks, docs, wheel/sdist, strict Twine and whitespace checks pass. Sixteen regression cases cover quantized outputs, zero/empty/short/oversized samples, 2,500 exact-arithmetic prefixes, adjacent floats and bounded cumulative error. Actual HTML output represents 600.0 s from 600.006 s of input, omitting only the final 6 ms. Existing MyST and setuptools license warnings remain.
Hosted run 38227860619 initially passed 21/23 jobs; two unchanged Ubuntu CLI sampling assertions failed. All new resampling tests and Read the Docs passed. The failure cause is not established; no successful rerun is claimed.
AI assistance: OpenAI Codex was used to investigate, implement and test this revision. No human review of the revision is claimed.