Skip to content

Make JournalStorage.may_omit_trials() reflect apply_discard - #306

Merged
c-bata merged 2 commits into
mainfrom
c-bata/fix-journal-may-omit-trials
Nov 13, 2026
Merged

c-bata merged 2 commits into
mainfrom
c-bata/fix-journal-may-omit-trials

Conversation

@c-bata

@c-bata c-bata commented Nov 12, 2026

Copy link
Copy Markdown
Member

Motivation

may_omit_trials() is documented as "Return True if this storage view may omit discarded trials." InMemoryStorage and SQLite3Storage return their apply_discard option, but JournalStorage returned whether a discarded trial had already been replayed. As a result, a JournalFileStorage created with apply_discard=True reported False until the first discard was applied.

Changes

  • Return apply_discard from JournalStorage::may_omit_trials(), consistent with InMemoryStorage and SQLite3Storage.
  • Add a Rust test checking that may_omit_trials() follows apply_discard both before and after a discard.
  • Add a Python test checking that JournalFileStorage(..., apply_discard=True).may_omit_trials() is True before any trial is discarded.

@c-bata
c-bata marked this pull request as ready for review November 13, 2026 01:18
@c-bata
c-bata merged commit 1d63491 into main Nov 13, 2026
9 checks passed
@c-bata
c-bata deleted the c-bata/fix-journal-may-omit-trials branch November 13, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant