-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: deduplication of mutated Substance programs in edgeworth
#1481
Conversation
± Registry diff
📊 PerformanceKeyNote that each bar component rounds up to the nearest 100ms, so each full bar is an overestimate by up to 400ms.
If a row has only one bar instead of four, that means it's not a trio and the bar just shows the total time spent for that example, again rounded up to the nearest 100ms. Data
|
edgeworth
edgeworth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for the PR. Some small refactoring for readability below.
Co-authored-by: Wode "Nimo" Ni <wn2155@columbia.edu>
Deploying with Cloudflare Pages
|
Description
Deduplication of program statements within a mutated Substance program exists in Edgeworth, but until now deduplication between mutated Substance programs themselves has not existed. This PR introduces such deduplication of programs themselves.
Implementation strategy and design decisions
We add a function
dedupSynthesizedSubstances
to SubstanceAnalysis.ts, whichreduce
s together the prettyprint strings of each program statement, compares the concatenated strings of each program supplied to it, and removes duplicates. Then, in thegenerateSubstances
function in Synthesizer.ts we rundedupSynthesizedSubstances
until the desired number of unique program mutations is reached.Examples with steps to reproduce them
Using the Edgeworth tool, generate 10 diagram mutations under the
lewis_0
option. Checking the Substance programs of each of these mutations will show that none of the programs are duplicates, though some programs still produce visually duplicated SVGs while having different underlying Substance programs. Consider the example below:These SVGs look the same but as shown in the next image, they have different Substance programs/underlying mutations:
This PR therefore ensures the uniqueness of displayed mutated programs but not the uniqueness of their diagrams.
Checklist
Open questions
This does not resolve the problem of mutated diagrams' SVGs appearing the same despite stemming from different, unique programs.