Skip to content

Test that a stale memmap preference cannot write through to a sidecar - #781

Merged
suraj-ranganath merged 3 commits into
developfrom
suraj/741-stale-memmap-sidecar-test
Nov 28, 2026
Merged

suraj-ranganath merged 3 commits into
developfrom
suraj/741-stale-memmap-sidecar-test

Conversation

@suraj-ranganath

Copy link
Copy Markdown
Member

Part of #741 and #777. Follow-up to #719.

The #719 test used a single-file dataset, which never touches sidecar mapping. This test loads a real two-file dataset with a stale memmap preference set, writes to the returned array, and reopens the file from disk. Before the #719 fix the first stored sample changed from 0 to -123; now it stays 0.

Test only, no runtime change. tests/test_storage.py: 5 passed.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @suraj-ranganath's task in 46s —— View job


Code review

  • Overall assessment: Looks good. The three added lines check the [GUI] Remove options with no meaning in Python from Preferences #719 fix on the path the earlier test missed, a two-file .set + .fdt load. Before [GUI] Remove options with no meaning in Python from Preferences #719, pop_loadset returned a MemmapData opened in r+ mode (memmap_fdt, storage.py:905) whenever option_memmapdata was on. So in_memory["data"][0, 0, 0] = -123.0 wrote into the shared page cache, and the pop_loadset(set_file, memmap=True) that follows would have seen -123 at line 60. Now _load_options (pop_loadset.py:198) only maps the file when the caller passes memmap explicitly, so the sidecar stays untouched.
  • Highest-risk area: How clear the test is, not whether it's correct.
  • Merge recommendation: Safe to merge.

Blocking

None.

Important

None.

Nits

  • Clarity of the regression check: tests/test_storage.py:52-54. The new lines sit inside test_pop_saveset_twofiles_roundtrips_epoched_data_as_memmap. The assertion that actually catches the regression is line 60, loaded["data"][0, 0, 0] == data[0, 0, 0], and it reads like an ordinary roundtrip check. If this regresses, the failure will look like a broken memmap roundtrip, not "a stale option wrote through to the sidecar." Extending the nearest existing test follows AGENTS.md, so this is optional. Two cheap ways to make the intent obvious:

Test gaps

None. Reopening with memmap=True is the strictest check here: it shares the page cache, so it catches writes even when nothing was flushed.

EEGLAB parity notes

None. The change is test-only and has no runtime effect.


  • Pre-review gate (PR open, not a draft, checked-out commit matches the PR head 7517d40)
  • Read AGENTS.md §Testing
  • Correctness: checked _load_options, _load_sidecar_data and memmap_fdt (opens in r+ mode) to confirm the test would have failed before [GUI] Remove options with no meaning in Python from Preferences #719
  • Run tests/test_storage.py myself: shell permission was denied in this job, so I'm relying on the result in the PR description (5 passed)

Checked for correctness bugs, EEGLAB parity, data structure compatibility, changed-behavior tests, and CLAUDE.md/AGENTS.md compliance.

@suraj-ranganath
suraj-ranganath merged commit dd89856 into develop Nov 28, 2026
10 checks passed
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.

1 participant