Skip to content

refactor(research): move the research modules into src/research/ - #1139

Merged
DrunkOnJava merged 17 commits into
mainfrom
refactor/research-dir
Oct 30, 2026
Merged

DrunkOnJava merged 17 commits into
mainfrom
refactor/research-dir

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Moves the 75 research modules from src/ into src/research/, declared as plain modules in src/research.rs instead of one #[path] attribute each. Module paths (crate::partition_schema_mvp, rvt::research::*) do not change, so this is a pure move: 75 R100 renames plus five edited files.

Stacked on #1136 (its commits show here until it lands; this PR stays a draft until then and takes an update-branch merge, so only the move remains).

Motivation

The second of the four repository-audit refactors Griffin chose on 2026-10-30. The research readers sat beside the stable modules, so nothing in the tree said which files are outside the semver promise (RELEASE.md, "What 1.0 keeps stable").

Changes

  • src/<m>.rs → src/research/<m>.rs for every module src/research.rs declares (75, including native_json from refactor: one copy of each byte, GUID, JSON-id, geometry and storey helper, and one ArcWall scan per file #1136, which is pub(crate)).
  • src/research.rs: the #[path] lines go.
  • Current-state mentions of the moved paths: docs/support-matrix.json evidence (15), probes/examples/probe_re207_element_parameters.rs, tools/re/element_parameters_vs_ifc.py, and CONTRIBUTING's probe step (a new research reader goes in src/research/). Reports, dated notes and the changelog keep the paths they were written with.

Checked before pushing: no moved file declares a child module or uses include_str!/include_bytes!/include! with a relative path (both would resolve differently one directory down); the crate's include allowlist is /src/**/*.rs, so packaging is unchanged.

Testing

Unit tests are banned in this repository. No local builds on this machine: CI is the compile gate. Exports must be byte-identical; a Measure run on the head confirms it before this leaves draft.

Audit-honesty checklist

  • Docs name the new paths; no capability changes
  • No user-visible change, so no changelog fragment
  • No emojis, private paths or internal jargon

Legal and contribution hygiene

  • Apache-2.0
  • No Autodesk proprietary content

Breaking changes

None: module paths are unchanged.

…nd quantise helpers

dot, sub and cross move from ifc/body_geometry and native_parametric_surface, distance from native_symbol_cuts and native_parametric_mesh, and the shoelace area from geometry/recovery and ifc/from_decoded into the private vector_math module, with the expressions unchanged. polygon_area_sqft keeps its public path and calls the shared function. quantise is shared from partition_element_records.
native_index reads native_extensible_storage::guid_string instead of its own copy. The 22-digit alphabet is one constant in revit_global_ids, and derive_default_ifc_guid calls compress_ifc_guid, which computes the same string.
partition_level_records and partition_ifc_export_overrides use the memchr-backed copy in partition_element_records. All three returned None for an empty needle or a haystack shorter than the needle and the first match otherwise.
partition_arc_walls names a storey through element_record_storeys::elevation_storey_name instead of its own identical format.
…elpers

native_json holds element_id (u64 and signed forms), finite_triple and agree, read by native_column_joins, native_connectors, native_element_types, native_mullion_hosts, native_rendered_content, native_stairs, native_symbol_cuts, native_wall_types and native_walls. The readers that differ stay in place: native_walls' triple (no finiteness check), native_stairs' element_id (as_u64), native_family_forms' Option argument and native_saved_mesh's Result point.
…imits

The production walk, the partition MVP and the IFC export (twice) each ran scan_partition_arc_walls_with_limits over every Partitions stream. RevitFile now memoises the scan under its release and WalkerLimits, as it does the walk; the public function returns a copy of the memoised scan and the four internal readers share it.
… le_bytes

The partition readers, compression and basic_file_info read integers, floats and UTF-16 units at an offset with the same bounds as before and through the one le_bytes module. le_bytes gains i32_at and u16_units for the reads the existing helpers did not cover.
… index and document readers

The reads that were bounds-checked by a get or an ensure! before an infallible try_into now use u16_at and u32_at with the same error text, and the UTF-16 unit decodes use u16_units. The walker, ElemTable, partitions and ArcWall trailer readers take the same helpers where the surrounding function already returned None on a short buffer.
…roof_slopes read ElementIds through native_json
…ported

Four calls already on main read crate::le_bytes::*_at in files this branch now imports le_bytes into, which the workspace's unused_qualifications lint (an error under -D warnings) rejects.
The 75 research modules sat in src/ beside the stable ones and src/research.rs
reached them with a #[path] attribute each. They now live in src/research/,
declared as plain modules, so the directory says which files are outside the
semver promise. Module paths (crate::partition_schema_mvp, rvt::research::*)
are unchanged.

Current-state mentions of the moved files (the support matrix's evidence,
one probe, one scorer, CONTRIBUTING's probe step) name the new paths; reports,
dated notes and the changelog keep the paths they were written with.
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Self-review. The diff against main is 75 R100 renames and five edited files: src/research.rs loses its 75 #[path] lines (every one in the plain form; native_json keeps its pub(crate)), and four current-state files name the new paths (the support matrix's evidence, one probe, one scorer, CONTRIBUTING's probe step). No moved file declares a child module or includes a file by a relative path, and the crate's include list is /src/**/*.rs, so packaging is unchanged. The merge from main (64b3a0d) resolves #1136's native_json addition to the moved file; its tree is identical to the move commit 1176f48.

Verification: fmt, clippy, rustdoc (including the docs.rs preview), the MSRV build and the packaged-crate build pass on 64b3a0d. Measure run 41043084890 (-f ref=64b3a0df -f base=main -f scorers=none): all 6 default models' ifc.sha256 identical to main's. Nothing to fix.

@DrunkOnJava
DrunkOnJava marked this pull request as ready for review October 30, 2026 10:48
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 30, 2026 10:48
@DrunkOnJava
DrunkOnJava merged commit 580982d into main Oct 30, 2026
28 checks passed
@DrunkOnJava
DrunkOnJava deleted the refactor/research-dir branch October 30, 2026 10:57
DrunkOnJava added a commit that referenced this pull request Oct 30, 2026
## Summary

Ten rows of `docs/support-matrix.json` cited unit tests or "unit gates"
in research modules as evidence. #1126 deleted every `src/` unit test,
so those citations pointed at tests that no longer exist. The rows now
cite only what still runs: the integration tests under `tests/`, the
probes, the scorers and the reports.

## Motivation

The support matrix is the honesty ledger (`tests/support_matrix.rs`);
evidence that names deleted tests overstates what is checked. Found
while moving the research modules (#1139).

## Changes

- `docs/support-matrix.json`: rows `element-record-stair-dimensions`,
`element-record-beam-axes`, `element-record-roof-outlines`,
`element-record-stair-treads`, `revit-global-ids`,
`element-record-slab-plan-profile`, `element-record-wall-join-trim`,
`element-record-column-type-symbol`, `element-record-wall-type-join` and
`record-level-storeys-2025` lose their unit-test clauses. No status
changes: every row is `partial`, and each keeps its integration tests,
probes and reports.

## Testing

N/A for behaviour: evidence text only. Checked that every
`tests/<file>.rs::<fn>` the rows still cite exists, and that the file
parses as JSON.

## Audit-honesty checklist

- [x] Docs reflect the current state: no evidence names a deleted test
- [x] No user-visible change, so no changelog fragment
- [x] No emojis, private paths or internal jargon

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary content

## Breaking changes

None.
DrunkOnJava added a commit that referenced this pull request Oct 30, 2026
…sibility (#1141)

## Summary

Splits `src/research/partition_schema_mvp.rs` (12,553 lines) into 19
child modules by responsibility, under
`src/research/partition_schema_mvp/`. The parent keeps the module doc,
`PartitionSchemaMvp`, the `recover_partition_schema_mvp` orchestrator
and the helpers every responsibility shares, and re-exports each child
with `pub use <child>::*`, so every `partition_schema_mvp::<item>` path
used in `src/`, `tests/`, `probes/` and `docs/` resolves as before. It
is a pure move: bodies, doc comments, attributes and the relative order
of items are unchanged.

Stacked on #1136 and #1139, both of which have since landed on main
(squash commits f07614f and 580982d); this branch merged main, so only
the split remains in the diff. It stays a draft until a Measure run on
the head confirms the move is byte-identical.

## Motivation

One of the repository-audit refactors Griffin chose on 2026-10-30: one
12.5k-line file held 175 constants and about 200 functions for a dozen
unrelated responsibilities.

## Changes

- `partition_schema_mvp.rs` (1,130 lines): module doc, imports,
`PartitionSchemaMvp`, `recover_partition_schema_mvp`,
`element_record_decoded`, `element_record_bbox`, `record_references`,
`element_source_stream`, `partition_streams_largest_first`,
`rect_openings_from_partitions`, and the `mod` / `pub use` lines.
- `fields` (933): all 175 constants.
- `types` (961), `parameters` (282): type picks and names, system
families, type functions; named parameters, `IsExternal`, phases
created, serial numbers.
- `openings` (765), `curtain` (399), `materials` (704), `layers` (292).
- `walls` (728), `wall_joins` (453).
- `stairs` (730), `stair_bodies` (1,111), `framing` (509), `mep` (750),
`rooms` (289).
- `slabs` (592), `roofs` (862), `levels` (511).
- `records` (495), `records_2023` (325): category and instance
selection, host binding, design-option and nesting filters; the Revit
2023 record path.

The only edits to moved text:

- `pub(super)` on the 148 private top-level items that left the parent
(the file has no private struct fields or methods).
- `fields.rs` has no `use super::*;`, since none of its constants names
anything outside it. Five of its doc links named a function that now
lives in another child, so they read `[`super::system_family`]`,
`[`super::attach_is_external`]`, `[`super::bind_opening_hosts`]`,
`[`super::roof_slope_edge_fields`]` and
`[`super::roof_slope_plate_offset_field`]`.
- The imports only one child uses moved into it (`le_bytes` into
`curtain` and `openings`, `partition_arc_walls` / `PartitionArcWall`
into `levels`, `NameBucket` / `classify_name` into `materials`,
`FRAC_PI_4` into `walls`), so the parent has no unused import.

Checked before pushing: every original non-blank line appears in the new
files the same number of times, except the added `pub(super)` tokens,
the `mod` / `pub use` / `use super::*;` / child `//!` lines, the five
doc links and the moved imports; `rustfmt +stable --edition 2024
--check` passes on the parent and every child, and rustfmt's own changes
(29 signatures rewrapped by the longer visibility prefix) differ from
the unformatted output only in whitespace and trailing commas. Every
`partition_schema_mvp::<name>` that code outside the module uses
(`src/`, `tests/`, `probes/`, `fuzz/`, `tools/`) names a `pub` item; the
non-`pub` names that remain are prose in docs and reports, as before.

## Testing

Unit tests are banned in this repository. No local builds on this
machine: CI is the compile gate.

- [ ] `tools/check-local.sh` passes: not run here (no local
compilation); `CI passed` is the gate
- [ ] Verified end to end on real Revit files: a Measure run on the head
must show byte-identical IFC hashes (`-f base=main -f nordic=true -f
r2025=true`) before this leaves draft
- [x] Does not touch the IFC exporter's behaviour; the witness verdicts
need no refresh
- [x] Not a performance change

## Audit-honesty checklist

- [x] Docs name no moved line numbers: `docs/support-matrix.json` cites
`partition_schema_mvp::<item>` module paths, which still resolve
- [x] No user-visible change, so no changelog fragment
- [x] No new limitation
- [x] No emojis, private paths or internal jargon

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary content
- [x] No new test fixtures

## Breaking changes

None: the module's public items keep their paths.
Repository owner deleted a comment from chatgpt-codex-connector Bot Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant