Skip to content

Conversation

@dcherian
Copy link
Contributor

Looks like it's catching a version of that bug.

E           Falsifying example:
E           state = SerialParallelStateMachine()
E           forking with pickle
E           state.fork_pickle()
E           merging forks to base session, merging 1→2→parallel
E           state.merge(two_to_one=False)
E           forking with pickle
E           state.fork_pickle()
E           merging forks to base session, merging 1→2→parallel
E           state.merge(two_to_one=False)
E           Draw 1: int8(1)
E           Adding array:  path='00'  shape=(1, 1, 1)  chunks=(1, 1, 1)
E           state.add_array(array_and_chunks=(array([[[0]]], dtype=int8), (1, 1, 1)), data=data(...), name='00')
E           Draw 2: int8(0)
E           Adding array:  path='0'  shape=(1,)  chunks=(1,)
E           state.add_array(array_and_chunks=(array([0], dtype=int8), (1,)), data=data(...), name='0')
E           forking with pickle
E           state.fork_pickle()
E           Draw 3: '00'
E           Draw 4: '0/0/0'
E           deleting chunk path='00/c/0/0/0'
E           Draw 5: ('parallel', <icechunk.session.Session object at 0x11476e570>)
E           executing on parallel
E           state.delete_chunk(data=data(...))
E           merging forks to base session, merging 1→2→parallel
E           state.merge(two_to_one=False)
E           verifying all arrays
E           state.verify_all_arrays()
E           state.teardown()

@dcherian dcherian marked this pull request as ready for review June 27, 2025 20:59

# @precondition(lambda self: self.has_forks())
# @rule(commit_fork1_first=st.booleans())
# def commit_on_forks(self, commit_fork1_first: bool):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems hard. I think we might need a different test that exercises rebase

self.fork1 = None
self.fork2 = None

@precondition(lambda self: not self.has_forks() and self.has_changes)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is basically saying we expect the user to fork, merge, and then commit the "base" parallel session


@precondition(lambda self: bool(self.all_arrays))
@rule(data=st.data())
def write_chunk(self, data: st.DataObject) -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is problematic. We could draw the same path on two draws which would model the case where parallel writers write to the same chunk and behaviour is undefined. I guess I can filter on chunk paths not in self.serial.status().updated_chunks[array]

self.parallel.commit("foo")

self.serial = self.repo.writable_session("main")
self.parallel = self.repo.writable_session("parallel")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should verify_all_arrays here because we expect the state on main and parallel to be identical after committing.

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