Skip to content

Make counter-examples safe on a shared Gen.Const base - #103

Open
Mpdreamz wants to merge 1 commit into
mainfrom
heed/browse/issue-46-7074da
Open

Mpdreamz wants to merge 1 commit into
mainfrom
heed/browse/issue-46-7074da

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

Closes #46

Invariant and Vacancy run at the same time over one Gen.Const base, so they share one MockFileSystem. Two things raced on it:

  • FileWorld's name counter was Value++ and its edits were unlocked, so two threads could make the same symlink (The file 'path' already exists).
  • A counter-example passed to AutoTest ran once per axis against the same base.

Fix: the counter is atomic and FileWorld draws lock the file system; a given counter-example now runs once per base (under a lock on it) and later axes reuse the result. The file system is not cloned, so a counter-example that edits the base's own file still changes it; the README says to add files instead.

Test: A_counter_example_that_adds_a_file_survives_axes_running_at_once_on_one_constant_base failed with the IOException before the fix (also after only the AutoTest half) and passes 6 of 6 runs after, on net10.0 and net11.0. Nullean.Entities.CsCheck.Tests (312) pass.

🤖 Generated with Claude Code

A Gen.Const base is one MockFileSystem, and axes run at the same time.
FileWorld's name counter was not atomic and its file-system edits were
unlocked, so two threads could create the same symlink; a given
counter-example was applied once per axis. The counter is now atomic,
draws lock the file system, and a counter-example given to AutoTest runs
once per base under a lock on it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

A Gen.Const base holding a MockFileSystem is shared and mutable across counter-examples

1 participant