Skip to content

Compare public fields in execution-results.h#8501

Draft
tlively wants to merge 1 commit intomainfrom
log-public-types
Draft

Compare public fields in execution-results.h#8501
tlively wants to merge 1 commit intomainfrom
log-public-types

Conversation

@tlively
Copy link
Member

@tlively tlively commented Mar 20, 2026

When comparing two logged struct or array values, look up their closest public supertypes. If these supertypes are different, then the values are observably different. Otherwise, look at the fields the shared public supertype makes visible and recursively check for differences. Since GC data may in general be recursive, naively recursing may cause the comparison to exhaust the stack or fail to terminate. Instead, perform a coinductive equality check where pairs of values are assumed to be equivalent until proven otherwise. This avoids recursing into the comparison of a pair of values we have already started comparing.

Since two execution traces typically differ only when the fuzzer finds a misoptimization, add a new gtest file to test the new comparison logic.

When comparing two logged struct or array values, look up their closest public supertypes. If these supertypes are different, then the values are observably different. Otherwise, look at the fields the shared public supertype makes visible and recursively check for differences. Since GC data may in general be recursive, naively recursing may cause the comparison to exhaust the stack or fail to terminate. Instead, perform a coinductive equality check where pairs of values are assumed to be equivalent until proven otherwise. This avoids recursing into the comparison of a pair of values we have already started comparing.

Since two execution traces typically differ only when the fuzzer finds a misoptimization, add a new gtest file to test the new comparison logic.
@tlively tlively requested a review from a team as a code owner March 20, 2026 01:04
@tlively tlively requested review from kripken and removed request for a team March 20, 2026 01:04
@tlively
Copy link
Member Author

tlively commented Mar 20, 2026

There is a known issue with this where unsubtyping makes makes it so a private subtype of a public type is no longer a subtype of that public type, which causes the comparison to fail. It seems we need to record the static type with which each particular value was exposed rather than using public supertypes.

@tlively tlively marked this pull request as draft March 20, 2026 01:11
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