fix(bench): default to incremental GC under EOP, imply legacy persistence for legacy collectors#606
Merged
Conversation
…ence for legacy collectors `mops bench` crashed on moc 0.15+ with the default `--gc copying`: `--copying-gc` is rejected under enhanced orthogonal persistence (the default persistence mode since 2.16.0). moc fixes the GC to incremental under EOP, so the default GC is now `incremental`. Selecting a legacy collector (copying/compacting/generational) implies `--legacy-persistence`, the only mode where moc accepts them. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Cursor AI review👍 APPROVE — looks safe to merge
VerdictDecision: APPROVE Generated for commit 91a2d45 |
Co-authored-by: Cursor <cursoragent@cursor.com>
Inline getMocArgs back into bench.ts (drop the bench-gc-args.ts extraction) and replace the isolated unit test with an end-to-end test that runs `mops bench` against a fixture pinning moc 1.3.0 + pocket-ic 12.0.0 — exercising the enhanced-orthogonal-persistence path that the default `--gc copying` crashed on. Verified the test fails against the pre-fix state with the original moc error and passes with the fix. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…nce) Co-authored-by: Cursor <cursoragent@cursor.com>
alexandru-uta
approved these changes
Jun 30, 2026
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.
mops bench(no--gcflag) crashed on moc 0.15+ — a regression from 2.16.0 (#601), which made enhanced orthogonal persistence the default bench mode but left the default--gcascopying. moc fixes the GC toincrementalunder EOP and rejects the legacy collectors there, so the default run was an invalid flag combination.Before — default
mops bench:After — default
mops benchcompiles under EOP with no collector flag (incremental is moc's fixed GC there):--gc copying|compacting|generationalstill works: those collectors only exist under legacy persistence, so selecting one now implies--legacy-persistence(instead of crashing with an opaque moc error).--gc incrementalor omitting--gckeeps measuring under EOP.Why the bug evaded detection
#601 switched bench to EOP-by-default and smoke-tested with
--gc incremental, but the--gcdefault stayedcopying, so the unflaggedmops benchinvocation everyone runs was never exercised. More fundamentally, there was nomops benchend-to-end test at all — and this repo's ownmops.tomlpinsmoc 0.14.14(pre-EOP), so even the local bench never touched the EOP path. The crash only surfaced on a downstream project (motoko-core) running a newer moc.This PR adds an e2e test (
cli/tests/bench.test.ts+cli/tests/bench/fixture) that pinsmoc 1.3.0+pocket-ic 12.0.0and runsmops benchfor real, asserting exit 0 and noInvalid compiler flag combination. Verified it fails against the pre-fix state with the original moc error and passes with the fix.Migration
Default benchmark numbers shift from
copying(legacy) toincremental(EOP) — but 2.16.0 already shifted numbers by switching persistence modes, andincrementalis the only GC consistent with EOP-by-default. To reproduce the old legacy-mode measurements:mops bench --gc copying(now auto-enables--legacy-persistence).