Repository navigation
Conversation
get_current_knot() returned hash_string("dead") rather than
hash_string("body.dead") for every stitch of a story's first-compiled
knot, and the full path for the stitches of every other knot. Which
form a caller got depended on where the knot fell in the alphabet.
start_container() files every child under indexed_children as well as
named_children, and every named child is filed at index -1. The map
keeps only the first, so each container's first named child is in both.
build_container_hash_map() walks named_children under the child's own
name, then walks indexed_children again under the parent's name, so
that one child's named children were hashed one level short and
overwrote the right _hash. At the root, that is the first knot: its
stitches came out as bare names, and the container hash table gained
an entry for each bare name as well.
The indexed walk now skips a child that is also named, since it was
hashed in the named walk.
Found by recording get_current_knot() at every ending of 70 stories:
three reported hashes that matched no knot or stitch path, all
stitches of the alphabetically first knot. With the fix, every ending
of all 70 matches its full path.
Loading a snapshot into the story it was taken from threw "Invalid
container id reference." or "tracked containere are not allowed to
move" for many stories: any with a sequence ({a|b}, {stopping:},
{cycle:}, {shuffle:}), and some with a labelled gather inside a choice.
globals_impl::snap_load() re-derived every tracked container from the
name hash stored with its visit count, even when not migrating. That
lookup is not one-to-one: a sequence's container is tracked but has no
name of its own, so its hash is 0 and resolves to nothing, and named
containers below an indexed one are hashed without the index, so two
containers can share a hash and resolve to the other one.
When not migrating the counts are loaded in container order, so the
lookup is not needed: compare the stored hash with the container's own
instead, which still catches a snapshot from a different story. The
migration path is unchanged.
Found by snapshotting at every choice of 70 stories and restoring 1-4
choices back (32,031 restores): 3 stories threw before, none after,
and every replay matched the original run.
…of the same story loader::migratable only indicates that the snapshot was taken in a migratable state Added loader::migrate to indicate that the snapshot must be migrated (story hash !=)
Wrong argument order
Name them by their index like ink paths do ("knot.0.3.b.c-0"), and add the
tracked ones to the container hash so migrate_to() can find them.
Ink Proof ResultsThese results are obtained by running the Ink-Proof Testing Suite on the compiled binaries in this pull request.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test pipeline run for edits on #176