refactor(encoding): ADR 0001 — all 6 phases#30
Closed
dfa1 wants to merge 2 commits into
Closed
Conversation
Owner
Author
Honest accounting after attempt at deletion cleanupTried to do the deletion pass tonight. Reverted because it would have broken ~30 test files that exercise decode logic by directly constructing the bifunctional Encoding class (e.g. Current state of PR:
Net effect: PR is pure code addition (~12K LOC). No deletions. Lift is duplication, not migration. Why the deletion didn't happen:
Both paths are multi-hour follow-up work. Stopping here rather than landing half-broken changes. Recommended next PRs (each independent):
The structural foundation (interfaces, facades, ServiceLoader manifests, standalone dispatch) is solid. Bulk deletion is mechanical once the test-side dependency is broken. |
f354409 to
ae5019a
Compare
`elementCount` is a final field — JIT hoists it; local alias adds noise. Spotted via IntelliJ MCP integration (pretty cool tbh). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Separate core's bifunctional encoding model into distinct read and write runtimes. **Encoder/decoder lift** Each encoding gets a standalone EncodingDecoder (reader module) and EncodingEncoder (writer module). 33 *EncodingTest classes move to writer/encode or reader/decode per their primary role. **Phase 0 — Encoding metadata-only** Encoding interface and all 32 *Encoding stub classes deleted from core. Shared algorithmic constants (F10 tables, FL_ORDER, FL_CHUNK_SIZE, dtype constants) and helpers (transposeIndex, iterateIndex, etc.) inlined as private static into the *EncodingDecoder/*EncodingEncoder that use them. EncodeContext.encodings (Registry) replaced by encoders (Map<EncodingId,EncodingEncoder>). CascadingCompressor moves to writer.encode. Registry becomes extension-only registry. **Phase 1 — decode types to reader** DecodeContext, ArrayNode (+subtypes), EncodingDecoder, and FlatSegmentDecoder move from core.encoding to reader.decode / reader. ReadRegistry replaces Registry.decode() as the canonical read dispatcher. VortexReader, VortexHttpReader, VortexHandle, ScanIterator all take ReadRegistry. Test infra: TestRegistry, TestDecodeContexts, DecodeTestHelper move to reader/test (new test-jar); writer/test gains vortex-reader:test-jar dep. ReadRegistryTest replaces the decode subset of RegistryTest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c9f036a to
1e7884b
Compare
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.
Summary
Lands every phase of ADR 0001 as 7 commits on one branch. ADR 0001 proposed splitting the read and write runtimes out of
core; this PR delivers the structural foundation + exemplars for the per-family lifts.b6437eeReadRegistry+WriteRegistrydelegating facades overRegistry.1750aa1EncodingDecoder+EncodingEncoderinterfaces.Encodingbecomes a marker that extends both.ed297cdBoolEncodingdecoder lifted intoreader/decode/BoolEncodingDecoder.Registry.standaloneDecodersmap + SL load. Standalone decoders take precedence over bifunctional fallback.f21e5abBoolEncodingencoder lifted intowriter/encode/BoolEncodingEncoder.Registry.standaloneEncodersmap.71e39c6VortexHandle.decodeFlatSegment(...)typed accessor.ScanIterator.readFlatandVortexInspectorTuidictionary preview migrated off rawslice().a772b00ExtensionEncoderinterface.Extension extends ExtensionEncoder.9eb2d32docs/compatibility.mddocuments the read-only deployment artifact subset (./mvnw -pl core,reader,inspector verifyis the verified subset).Tests
./mvnw verifygreen after every commit. 938 unit + 243 integration tests pass, including the Rust cross-language round-trip suite.What's left as mechanical follow-up
Phases 2 and 3 each lifted one encoding family (
BoolEncoding) as exemplar. The remaining ~29 encoding families follow the same shape:*EncodingDecoderinreader/decode/and*EncodingEncoderinwriter/encode/; add lines to the respectiveMETA-INF/services/manifests; remove the correspondingdecode()/encode()methods from the core*Encodingclass once both sides are lifted; eventually delete the core*Encodingfile entirely.Phase 4's typed accessor migration is partial — 2 of the 6 cross-package
slice()callers were migrated. The remaining 4 (ScanIterator.readFlatStats,InspectorTree.peek×2,VortexInspectorTuihex peek, integration test inspector walk) need their own typed accessors beforeslice()can be removed from the publicVortexHandleinterface. Each is a small focused PR.Phase 5's
Extensionsplit is also a foundation — concrete spec-extension encoders (Date/Time/Timestamp/Uuid) are not yet lifted into the writer module. Same mechanical follow-up shape as Phase 2-3.Test plan
./mvnw verifygreen after every commit./mvnw -pl core,reader,inspector verifybuilds the documented read-only subsetstandaloneDecoders.getOrDefault(id, encodings.get(id))precedence ruledecodeFlatSegmenttyped accessor signature🤖 Generated with Claude Code