Repository navigation
refactor(hermes): fold duplicated base/raw/transform logic, update v99 docs - #99
Conversation
- classifyHermesCommand: the build / commitly / stable version forms share one result instead of three identical return blocks - resolveHermesBase never read its hermesCommand parameter; drop it - hermes-base: one isBundleHash() for the four cache-name checks - hbcTransform: tryTransformPair and tryTransformPairFiles share the same-version check and the meta builder; the late-v98 and v99 layouts were identical apart from the version and become one 98..99 entry, and the early-v98 header is the late one minus numStringSwitchImms. The candidates and wire layout for every version 80..100 are byte-identical to before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
readHermesSemanticData ran the same first-fitting-layout search twice (resolveHbcSections, then pickLayout on the same bytes); resolveHbcSections now returns the layout it chose and pickLayout is internal again. The raw dump splitter calls normalizeRawHermesFunction through one local helper instead of three copies of the same call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the three "server ignores Range" catches share rangeIgnored(), and the two full-archive endings share fromArchive() - resolveHermesBase computes `source` after the null-record check, picks the artifact type once instead of per attempt, and checks a cache hit in one branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- hermes-base-verification.md: v99 (hermes-compiler 260318099.0.4) in the verified range, the shaped-layout tables and the CI matrix (four jobs); a note on the v99 function header and the undecoded NewTypedObjectWithBuffer; the `literals` result field is not logged, so step 5.3 now keys off the detail text - fold the one lasting rule of hermes-review-follow-up.md (keep the pretty pass: raw does not cover exception-handler tables) into it and drop that PR #85 review log - hermes-base pointed at a design doc that is not in the repo; v98-only comments now say v98 and v99 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
compareHermesBytecode read both files whole for the semantic data, then reopened them to read the header and three literal sections again. The literal buffers are now views into the bytes already in memory (literalBuffersFromBytes / hermesSemanticData); the file-based readLiteralBuffers and readHermesSemanticData stay as thin wrappers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pretty (hermes-base) and raw (hermes-raw) dump readers each had their own operand-width suffix fold and function-header regex; hermes-raw now exports both. The two line splitters stay separate: only the raw one strips CR, and unifying them would change the pretty pass on CRLF output, which no test or CI job exercises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable issue remains from this review. The change is mergeable after normal checks. Pre-merge checks |
|
Step 4 of the cleanup: the Hermes modules (hermes-base, hermes-raw, hermes-literals, hbcTransform) and their docs. No behavior change is intended. Every change is checked against the full local HBC matrix (see Verification).
Changes
numStringSwitchImms.tryTransformPairandtryTransformPairFilesshare the same-version check and the meta builder.resolveHbcSectionsalready picked instead of running the same search again viapickLayout.normalizeRawHermesFunctioncall.foldWidthSuffixandisFunctionHeaderfor the pretty pass.classifyHermesCommand: one result instead of three identical return blocks.resolveHermesBase: drop its never-readhermesCommandparam; computesourceafter the null check; pick the artifact type once; handle a cache hit in one branch.fetchBaseBundle: the "server ignores Range" fallbacks sharerangeIgnored()/fromArchive().isBundleHash()replaces the four cache-name regexes.hermes-base-verification.mdnow covers HBC v99: the verified range, the shaped-layout tables, the four-job CI matrix, the v99 function header, and the undecodedNewTypedObjectWithBuffer.literalsfield is not logged.hermes-review-follow-up.mdis removed.Deliberately not changed
dump-failedinstead ofrejected, and the fake-hermesc harness relies on it.Verification
bun run lintpasses;bun test: 584 pass, 32 skip, 0 fail.Local copy of the CI
hermes-integrationmatrix (same pinned compilers and Metro fixtures with sha256 checked), withtests/hermes-*.test.tsplus 50 seeded fuzz rounds each:The counts match a master baseline taken the same way.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit