Repository navigation
refactor: organize the parser into subsystem modules (#380 part 2) - #389
Merged
Merged
Conversation
Replace the flat module list and #[path] attributes with real directories
(format, catalog, definition, row, long_value, alloc, index/{key,tree},
properties, relationship, write, schema, create, validate). Tests sit beside
their module. Add scripts/golden-check.sh to compare database outputs of two
revisions byte for byte.
All parser modules are now crate-private. Root re-exports used by the CLI, test kit, examples, fuzz targets, benches or named by the public API stay public (guarded by #![warn(unnameable_types)]); writer internals become pub(crate). Remove the unused `create` alias and the re-export chains in column_writer, definition::index and create. Test-only encoders and accessors move under #[cfg(test)] or into their test files; never-constructed candidate check variants are removed.
Define PAGE_BYTES once in format::header (replacing 17 local copies and JET3_PAGE_BYTES), collect the table-definition header offsets and record sizes in definition::header, share the data-page directory offsets from format::data_page_directory, and move page_tag beside PageKind. Drop stale dead_code allowances; test-only helpers move under #[cfg(test)] and unused constants are deleted.
Merge long_value mutation_map into mutation, row offsets into reader_layout, the Long key encoder into the scalar key module, update_key and counter into index::mutation, index_allocation into index::mutation_load, reuse_page and insert_eof into row::insert_page, slot into row::directory, schema publish into schema::edit, the two AutoNumber modules into write::auto_number, and mutation_map_write into alloc::mutation_map.
Rename the Numeric* index types to Scalar* (they also cover text, binary and GUID keys), InitialLongIndex to InitialScalarIndex, the candidate checks to image checks, and history-named test files by what they test. Collapse the General-only wrappers (catalog name validation/equality, NameKey, encode_table_definition, CreationProperties and the plan_table_schema chain) so callers pass the sort order or encoding context explicitly.
State what each operation does and how it fails, with one pointer to docs/plans/V1_SCOPE.md for scope, instead of listing experiment ids and construction details that live beside the code encoding them.
Add #[cfg(test)] testkit with the default budget, a self-removing TempDir, and the Jet 3 page-zero image builder, replacing 35 budget helpers, 14 hand-written temp-directory guards and 11 copies of the page-zero bytes.
oglassdev
added a commit
that referenced
this pull request
Sep 24, 2026
This was referenced Sep 24, 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.
Part 2 of #380. This restructures the
jet3parser crate without changing its behavior.Layout
Changes
#[path]attributes are gone. Tests sit next to their module as*_tests.rs.#![warn(unnameable_types)], and about 29 writer internals are nowpub(crate).pub use creation as createalias#![allow(dead_code)]attributes and the dead code under themlong_value_mutation_maprow_offsetslong_index_keyupdate_index_keyindex_counterindex_allocationrow_reuse_page,row_insert_eof,row_slotschema_publishauto_number_*mutation_map_writePAGE_BYTEShas one definition; it was repeated in 17 places.header[21..23]and43 + n*8arithmetic.Numeric*→Scalar*, since those types also handle Text, Binary and GUID.InitialLongIndex→InitialScalarIndex.CandidateCheckError→ImageCheckError.# Errorssection and a pointer toV1_SCOPE.md.testkitprovidesbudget()(35 copies before),TempDir(14 guards before) anddatabase_image.Left for the consolidation PR, on purpose:
reservehelpers and thepush<T>helpers, which charge work units and return errors differently from each otherRemoved from the public API (crate is 0.0.0)
jet3::<module>::paths. Everything is now reached through the root re-exports.atomic_update,atomic_create,atomic_create_with_hookencode_row,RowColumnLayoutDataPageBuilder,PageImage,page_tagencode_table_definition,TableDefinitionSpecencode_catalog_record,CatalogRecordSpec,catalog_record_lenSHARED_COMMIT_SLOT_COUNT,DATABASE_HEADER_PAGE_NUMBERCandidateCheckError, which was renamed to the crate-internalImageCheckError.Verification
Byte-identical outputs. The new
scripts/golden-check.sh 9638d38runs:jet3-clicreate/schema/mutate requestsvalidateon every outputAll 1,923 files match the base byte for byte (SHA-256), including each command's stdout, stderr and exit code.
Test counts.
cargo test -p jet3gives 823 passed, 6 ignored, 17 integration and 2 doc tests, the same as main.Windows.
cargo check --target x86_64-pc-windows-gnuis clean.just readypasses: 899 tests, 0 failures.🤖 Generated with Claude Code