-
Notifications
You must be signed in to change notification settings - Fork 4
fix(hermes-base): stop rejecting a base over a printed property name #85
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7da96bc
fix(i18n): soften account renewal reminder notice
sunnylqm 6b9b54b
fix(hermes-base): stop rejecting a base over a printed property name
sunnylqm 84940a2
fix(hermes-base): normalize cached shapes and require effective fuzz …
sunnylqm f996520
style: align Hermes review regressions with Biome checks
sunnylqm af34031
fix(fuzz): mutate real string literals instead of quote gaps
sunnylqm d64123e
test(fuzz): preserve runtime Unicode fixtures and guard parser tokens
sunnylqm 987a29d
style: format string-token regressions and mark intentional source text
sunnylqm e39729f
fix(fuzz): reject a missing rounds argument before starting work
sunnylqm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # PR #85 review follow-up | ||
|
|
||
| ## Changes | ||
|
|
||
| - `CacheNewObject` now resolves its shape index into the ordered, fully decoded | ||
| property keys in the pretty pass. Both registers and the per-function cache | ||
| index remain part of the comparison. Unknown shapes, undecodable keys and | ||
| unsupported operands fail closed. With no binary resolver, the shape is only | ||
| folded for diagnostics; the existing binary-data and raw-audit gates still | ||
| forbid text-only equivalence. | ||
| - Fuzz success requires a positive integer round count, all requested positive | ||
| comparisons, zero compilation/comparison failures, at least one effective | ||
| planted difference, and no missed or unbuildable negatives. Optimized-away | ||
| differences do not count. The last round also attempts a negative, so runs | ||
| shorter than ten rounds are not structurally unable to exercise rejection. | ||
| - New regressions cover shape-index relocation, key changes, key order, | ||
| register/cache preservation, malformed/missing references, text-only fallback, | ||
| and fuzz runs with zero or incomplete useful coverage. | ||
| - Enforcing that gate exposed a pre-existing generator defect in the HBC 96 | ||
| CI run (seed 96, round 41): the quoted-string regex matched a gap after an | ||
| escaped quote and inserted `~` before a quoted property name. String mutation | ||
| and negative planting now use real string-token boundaries from the already | ||
| installed Babel parser and JSON-encode replacements. The minimized regression | ||
| also checks comments, regexps, templates, escapes and UTF-16 source offsets. | ||
| The failure gate remains strict; the generator is fixed rather than skipping | ||
| the failing round or changing the seed. | ||
|
|
||
| ## Scope and evidence | ||
|
|
||
| The CacheNewObject regression uses synthetic instruction bytes and binary literal | ||
| sections to exercise the production pretty and raw normalizers. It does not claim | ||
| that a source-level fixture was compiled into CacheNewObject by a real hermesc. | ||
| The existing pinned HBC 96/98 compiler CI remains required before merging. | ||
|
|
||
| Unknown-opcode semantic coverage remains a separate follow-up, not a verified | ||
| current-compiler false-acceptance bug. Before accepting additional compiler | ||
| snapshots, audit their complete opcode/operand schemas and referenced sections. | ||
| Do not remove the whole pretty pass: information such as exception-handler tables | ||
| is not currently covered by the raw instruction normalizer alone. | ||
|
|
||
| Local validation in the authoring environment is limited to Node.js execution of | ||
| transpiled helpers and synthetic fixtures; Bun and hermesc are not installed. | ||
| The PR description records the subsequent CI state separately. | ||
|
|
||
| ## CodeRabbit argument-validation follow-up | ||
|
|
||
| Only an omitted `--rounds` flag selects the default of 200. A flag without a | ||
| value, an empty value, or a following option is rejected with exit code 2 before | ||
| creating the output directory or invoking the compiler. Four CLI regressions | ||
| use an executable compiler fixture with a call marker to verify those side | ||
| effects do not occur; the valid-count control verifies the marker does work. | ||
| Argument-reading, compilation and run-entry functions now document their contracts. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { parse } from '@babel/parser'; | ||
|
|
||
| export interface FuzzStringLiteral { | ||
| start: number; | ||
| end: number; | ||
| value: string; | ||
| } | ||
|
|
||
| /** Locate actual JS strings, never the gap between two closing/opening quotes. */ | ||
| export function fuzzStringLiterals(source: string): FuzzStringLiteral[] { | ||
| const { tokens } = parse(source, { | ||
| sourceType: 'script', | ||
| tokens: true, | ||
| errorRecovery: true, | ||
| }); | ||
| if (!tokens) throw new Error('Parser did not return string-token data'); | ||
| const literals: FuzzStringLiteral[] = []; | ||
| for (const token of tokens) { | ||
| if ( | ||
| typeof token.type === 'object' && | ||
| token.type.label === 'string' && | ||
| typeof token.value === 'string' | ||
| ) { | ||
| literals.push({ start: token.start, end: token.end, value: token.value }); | ||
| } | ||
| } | ||
| return literals; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| export interface HermesFuzzSummary { | ||
| rounds: number; | ||
| equivalent: number; | ||
| different: number; | ||
| dumpFailed: number; | ||
| compileErrors: number; | ||
| planted: number; | ||
| plantedMissed: number; | ||
| plantedCompileErrors: number; | ||
| } | ||
|
|
||
| /** A green run must contain all requested comparisons and an effective negative. */ | ||
| export function hermesFuzzSucceeded(summary: HermesFuzzSummary): boolean { | ||
| return ( | ||
| Number.isSafeInteger(summary.rounds) && | ||
| summary.rounds > 0 && | ||
| summary.equivalent === summary.rounds && | ||
| summary.different === 0 && | ||
| summary.dumpFailed === 0 && | ||
| summary.compileErrors === 0 && | ||
| Number.isSafeInteger(summary.planted) && | ||
| summary.planted > 0 && | ||
| summary.plantedMissed === 0 && | ||
| summary.plantedCompileErrors === 0 | ||
| ); | ||
| } |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.