Skip to content

test(entities): delete the entity decoders' inline mirror suites, 3,797 lines - #432

Merged
DrunkOnJava merged 2 commits into
mainfrom
test/delete-entity-suites
Oct 28, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
test/delete-entity-suites

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Unit-suite staged deletion, area entity decoders. The inline #[cfg(test)] modules of 39 files under src/entities/ build synthetic bit streams in each decoder's own field layout and assert the fields they decode, or round-trip them through a hand-written encoder. They are unit tests, which this repository bans, and no job runs them since the Test job moved to tools/ci/run_test_targets.sh (#428). Git history is the archive.

File (src/entities/) Tests Lines
hatch.rs 9 348
mleader.rs 2 243
modeler.rs 6 218
spline.rs 5 190
mesh.rs 3 186
attrib.rs 3 141
mline.rs 3 130
image.rs 3 124
polygon_mesh.rs 4 120
underlay.rs 4 110
dimension_linear.rs 3 109
dimension_aligned.rs 3 104
dimension_angular_3p.rs 3 104
dimension_ordinate.rs 3 102
dimension_radial.rs 3 99
dimension_angular_2l.rs 3 94
lofted_surface.rs 4 91
three_d_solid.rs 5 91
helix.rs 4 90
vertex.rs 4 87
proxy_entity_passthrough.rs 5 84
imagedef.rs 3 79
region.rs 3 74
ole2_frame.rs 4 72
body.rs 3 69
dimension_diameter.rs 2 69
revolved_surface.rs 2 69
attdef.rs 2 64
extruded_surface.rs 2 63
camera.rs 2 60
swept_surface.rs 3 54
wipeout.rs 1 51
polyface_mesh.rs 2 39
ray.rs 1 35
ellipse.rs 1 31
xline.rs 1 21
block.rs 1 19
endblk.rs 1 12
seqend.rs 1 12

Lines removed: 3,797 (117 tests). Production code is unchanged: each file's only #[cfg(test)] item is its test module, so no test-only helper goes with it, and no item can become dead code (one used only by tests would already warn in the non-test library build, which CI compiles with -D warnings).

Skipped: files an open PR touches

Checked against gh pr list --state open at push time. These 18 files keep their inline suites and get a later PR once the stack lands: arc, circle, dimension, dispatch, insert, leader, line, lwpolyline, mod, mtext, point, polyline, solid, text, three_d_face, tolerance, trace and viewport. The PRs are #323, #324, #355, #356, #410 and #412 (the R13 stack), #310, #311 and #427 (dispatch.rs, mod.rs). string_stream.rs, whose pub(crate) mod tests the test modules of these and of the objects/ and tables/ files use, goes after the last of them.

Coverage of the area

Every decoder here is self-validating: a field list must end exactly on the record's data-stream boundary, or it returns an error. What checks it now is the Corpus job, on every pinned drawing:

  • the per-file decoded, skipped and errored counts of tools/corpus/baseline.tsv, which fail on a change in either direction;
  • the DXF value oracle (tools/oracle/baseline.tsv), which compares every decoded field with AutoCAD's own export of the same drawing, and has rows for ATTDEF, ATTRIB, BLOCK, the seven DIMENSION subtypes, ELLIPSE, HATCH, MLINE, MULTILEADER, RAY, XLINE, the VERTEX records and POLYLINE_PFACE among these files;
  • canonical_corpus (class real), which reads the committed canonical fixtures through the dispatcher.

A type the pinned drawings do not contain has no real-file check at all, only the compile; the deletion removes the only check of those decoders (the ones the oracle has no rows for and the corpus holds no record of: among them the surfaces, helix, camera, ole2_frame, underlay, polygon_mesh and the ACIS records). The open PRs #392, #394, #396, #399 and #402 add oracle rows for TOLERANCE, SPLINE, MESH, IMAGE, WIPEOUT and LEADER.

Spec reference

Not a decoder change. No corpus count moves: tools/corpus/baseline.tsv and tools/oracle/baseline.tsv are untouched.

Test plan

Source-provenance declaration

By submitting this PR I certify that my contribution does not incorporate executable code from any source whose license is incompatible with Apache-2.0. Specifically:

  • No Autodesk DWG SDK source (RealDWG, ObjectARX, ObjectDBX) or NDA-protected Autodesk documentation was consulted or imported.
  • No Open Design Alliance Teigha / Drawings SDK source was consulted or imported. The ODA's public Open Design Specification for .dwg files PDF is explicitly allowed (see CLEANROOM.md).
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported. This matters because dwg-rs is Apache-2.0 and must remain compatible.

My contribution is based on:

  • The ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1);
  • Public reverse-engineering notes, research papers, or blog posts cited inline;
  • Reading algorithm-description comments (not executable code) in permissively-licensed projects (MIT / Apache / BSD) to resolve spec ambiguities: none were read for this change.

See CLEANROOM.md for the full allowed/forbidden source list and the honest scope of what "clean-room" means for this project.

Developer Certificate of Origin

By submitting this PR, I certify that the contribution complies with the Developer Certificate of Origin 1.1. Specifically, I affirm that the contribution is my own work (or rightfully licensed to me) and that it can be distributed under the project's Apache-2.0 license.

The inline #[cfg(test)] modules of 39 files under src/entities/ build
synthetic bit streams in each decoder's own field layout and assert the
fields they decode, or round-trip them through a hand-written encoder. They
are unit tests, which this repository bans, and no job runs them since the
Test job moved to tools/ci/run_test_targets.sh. Git history is the archive.

The 18 entity files an open pull request touches, among them dispatch.rs,
keep theirs until those land.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T12:58:41.143020Z 2d754a7 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 28, 2026 13:02
@DrunkOnJava
DrunkOnJava merged commit 6519fcd into main Oct 28, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the test/delete-entity-suites branch October 28, 2026 13:12
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