Skip to content

fix: clip DRAM coalescing to Simulator.run(until=) horizon - #4

Merged
chenshih1 merged 2 commits into
masterfrom
cursor/des-hotpath-coalesce-cf4c
Aug 27, 2026
Merged

chenshih1 merged 2 commits into
masterfrom
cursor/des-hotpath-coalesce-cf4c

Conversation

@chenshih1

@chenshih1 chenshih1 commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

Clip coalesced DRAM ticks to the active Simulator.run(until=) inclusive horizon so incremental windows cannot jump sim.now past until, drop dram.pending to 0, and leave the completion unfired.

Rebased onto current master (PR #1 squash 8c3fb50 + PR #3 squash 56cbafb). Coalescing itself is already on master; this PR keeps only the until-horizon clip.

Changes

  • Simulator.run(until=) publishes an inclusive time horizon while it runs.
  • Dram._max_tick_burst clips coalesced tick_until_progress bursts to that horizon, not only the next heap event.
  • _advance_to rejects jumps past the active horizon.
  • Nested run() restores the previous horizon.

Testing

  • ruff check pyramulator/ tests/ benchmarks/ examples/ passes
  • ruff format --check pyramulator/ tests/ benchmarks/ examples/ passes
  • mypy pyramulator/ passes
  • pytest passes
  • If the build changed: pip install -e ".[dev]" from a clean checkout works

Changelog

Has CHANGELOG.md been updated for user-visible changes? Yes.

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 27, 2026 12:26
Coalesced ticks only consulted the next heap event, so an in-flight
request could jump sim.now past until, drain dram.pending, and leave
the completion callback unfired. Publish the inclusive run horizon and
clip tick_until_progress bursts to it.

Co-authored-by: chenshih <chenshih1@users.noreply.github.com>
Keep the horizon RuntimeError on one line for ruff. After an in-flight
read completes under idle_refresh, idle ticks continue, so do not
require sim.now to equal the depart time.

Co-authored-by: chenshih <chenshih1@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/des-hotpath-coalesce-cf4c branch from 5ffed87 to 230c6bc Compare August 27, 2026 12:26
@cursor cursor Bot changed the title Coalesce empty DRAM cycles and clip to run(until=) horizon fix: clip DRAM coalescing to Simulator.run(until=) horizon Aug 27, 2026
@chenshih1
chenshih1 marked this pull request as ready for review August 27, 2026 12:26
@chenshih1
chenshih1 merged commit 8e63217 into master Aug 27, 2026
9 checks passed
@chenshih1 chenshih1 mentioned this pull request Aug 27, 2026
6 tasks done
chenshih1 added a commit that referenced this pull request Aug 27, 2026
Cut 0.5.3 from master after PRs #1–#4:
- DRAM empty-cycle coalescing and drive() drain accounting
- idle-refresh backoff reset, drive(batch=0) hang, cancel accounting
- coalescing clipped to Simulator.run(until=)
- Pipe+FIFO+Dram composition example, occupancy, and issue-pipe refill

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: chenshih <chenshih1@users.noreply.github.com>
@chenshih1
chenshih1 deleted the cursor/des-hotpath-coalesce-cf4c branch August 27, 2026 13:48
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