Repository navigation
Description
Purpose and evidence
Follow-up to #2237 (test sources). This is a tracking issue, not a claim that every failing assertion is a distinct interoperability bug.
Reproduced on 2026-10-27, macOS arm64, with acadrust 0.6.6, cargo-nextest 0.9.150, upstream base c3b8e7b7 plus test commit f6f79013d2b03c4dd1cd9c50ffc568272cd1feeb:
- 207 active tests in the new
roundtripmodule pass. - The initial 27 explicitly ignored drawing checks fail when run explicitly, grouped into 19 findings without double-counting shared DXF/DWG failures. Review follow-up A16 adds two failing codec checks, bringing the total to 29 checks / 20 findings. A16 was validated separately at commit
6cf920cea304ec0057036ba02f18836cbfc63865; the original baseline above remains the evidence for A1–A15 and B1–B4. - All drawings and byte fixtures are synthetic. No reference CAD application was used for these reproductions. Native DWG-object inspection bypasses one CADCraft bridge direction but uses the same codec.
- The failing families stop at their first failing case. The version/pass reported by an assertion is an observed witness, not evidence that every version and every case in that family was reached.
Current disposition
B4 (#2257) is resolved. B3 (#2256) awaits #2284. B2 (#2255) is a confirmed reader defect awaiting #1942; its field and legacy-placement regressions now run independently.
At ed37a1c8, the active matrix passes 215 tests; 25 drawing checks + 2 codec checks = 27 pending checks still fail explicitly. The additional placement check covers B2, not a new defect. PR #2237 remains test-only; historical baseline counts remain unchanged.
Reproduction
Until the test PR merges, check out its branch/head. The repository requires cargo-nextest >= 0.9.150.
# Run the remaining 25 pending drawing checks without stopping at the first failing test.
cargo nextest run -p cadcraft-io --test it \
-E 'test(/^roundtrip::/)' --run-ignored ignored-only \
--no-fail-fast --test-threads 2
# Run one exact check with cargo test instead (replace TEST with a name below).
cargo test -p cadcraft-io --test it 'roundtrip::TEST' -- --ignored --exactA1–A15 and B1–B4 test names below are relative to roundtrip::; A16 uses the separate cadcraft-dxf codec test binary. Tests live under crates/io/tests/it/roundtrip/; shared authored cases live in cases.rs / cases/. Normal CI skips these pending checks; a green CI run is not a resolution of this issue.
Individual issue tracking
Split into separately actionable issues following the discussion below: 18 new issues plus existing #1921 for A1; review follow-up A16 reuses existing #1025. Each A/B entry links to its individual issue. All 29 originally failing checks are accounted for (27 drawing checks plus 2 codec checks); an additional independent placement check now covers B2; shared-format manifestations remain together. B1–B4 began as contract decisions/investigations; follow-up has since established editing/placement defects for B2 and B3, as recorded below. Checkboxes remain open until resolution, not merely ticket creation.
A. Confirmed losses and numerical mismatches
Prioritize silent data loss before display/property discrepancies. Checkboxes mean the finding has been resolved and the relevant tests enabled, not merely that it has been reproduced.
-
A1 — DXF generated-handle exhaustion corrupts space ownership. A nine-entity drawing saves successfully with duplicate structural handles; reopening moves all nine model entities into
Layout2(all six DXF versions, ASCII/binary). This refines the earlier 0/9-model witness; the entities are not completely deleted. Preservation or explicit refusal is required. io: a handle at the top of the range leaves new objects their own #1276 fixes the import-overwrite witnesses but leaves writer exhaustion and introduces a lost GROUP reference during renumbering (review evidence). The paired DWG exhaustion check passes by refusing conversion, not by proving preservation. Large handles with allocation room have separate controls.- Individual issue: F-01: crafted handle saturates the seed, new entities silently overwrite existing work (High) #1921 (existing report; save/reopen evidence added).
handle_limits::dxf_exhausted_handles_are_preserved_or_refused- Related existing report F-01: crafted handle saturates the seed, new entities silently overwrite existing work (High) #1921, earlier fix(doc): saturated handle allocation reuses identities and can overwrite existing geometry #913, and open PR io: a handle at the top of the range leaves new objects their own #1276. This adds a save/reopen witness, not a duplicate new allocation issue.
-
A2 — DWG silently drops an unregistered entity. Successful R2000 save reopens with 1 instead of 2 entities. Require preservation of the payload/references or an explicit refusal, not silent success.
- Individual issue: DWG save silently drops an unregistered entity instead of preserving or refusing it #2240.
dwg::extended::unknown_entities_are_preserved_or_explicitly_refused- Related fix(dxf): audit and close remaining round-trip losses — unknown objects, foreign xdata, extension dictionaries, UCS, layer states (gaps.md FF1) #528 / fix(dwg): export removes unsupported custom objects without reporting them as lost #941 and PR io: open → save → reopen round-trip harness with loss report, cadcraft-cli roundtrip, cargo xtask corpus (FF5) #1937's loss reporting; those cover overlapping but not identical custom-entity/object paths.
-
A3 — Non-default extrusion is omitted on the shared DXF path. A LINE normal
(0,0,-1)becomes(0,0,1)through DXF and DWG. Independent output inspection confirms missing group 230; the independent LINE read fixture passes.- Individual issue: DXF/DWG save drops a LINE non-default extrusion; group 230 is omitted #2241.
dxf::common::writes_nondefault_extrusion_groupsdxf::entities::nondefault_extrusion_is_preserveddwg::entities::nondefault_extrusion_is_preserved- Open PR dxf: mirrored entities keep extrusion -Z; unchanged dimension text survives a save (FF1) #1942 is relevant; do not create a competing fix without checking it.
-
A4 — ByBlock plot style becomes ByLayer. DXF output is byte-identical for otherwise identical ByLayer/ByBlock drawings, so the distinction is already lost before rereading. DWG inherits the shared loss. Do not prescribe a guessed group encoding as the fix.
- Individual issue: DXF/DWG save conflates ByBlock and ByLayer plot styles #2242.
dxf::common::writer_must_distinguish_bylayer_from_byblock_plot_styledxf::entities::plot_style_byblock_is_preserveddwg::entities::plot_style_byblock_is_preserved
-
A5 — Named entity plot styles disappear through DWG.
ReviewbecomesByLayer, both alone (first witness R2000) and with other Common properties (R2004).- Individual issue: DWG save loses named entity plot styles (Review becomes ByLayer) #2243.
dwg::entities::named_plot_style_is_preserveddwg::entities::common_property_interactions_with_named_plot_style
-
A6 — Named layer plot styles disappear through DWG.
ReviewbecomesNormal(R2000 witness).- Individual issue: DWG save loses named layer plot styles (Review becomes Normal) #2244.
dwg::extended::layer_plot_styles- A4–A6 concern serialization, not importing CTB/STB files; feat(plot): apply plot style tables (CTB/STB) to plots and layouts (gaps.md F14) #410 is broader related plot-style work.
-
A7 — LEADER vertex elevations are flattened on the shared DXF path. Authored Z values
4and7become0in both formats.- Individual issue: DXF/DWG round trip flattens LEADER vertex elevations to zero #2245.
dxf::extended::leaders_3ddwg::extended::leaders_3d
-
A8 — ATTRIB constant flag becomes false.
trueon an attached attribute is lost through both formats; this is distinct from preserving the ATTDEF flag alone.- Individual issue: DXF/DWG round trip clears the constant flag on attached ATTRIB values #2246.
dxf::extended::constant_attributesdwg::extended::constant_attributes- Related historical fix(dxf): saving drops block descriptions and makes constant attribute definitions variable #204; the reproduction is the attached ATTRIB path.
-
A9 — MTEXT column width is also read as entity linetype scale. The DXF column case changes
Common.ltscalefrom1.0to12.5(group 48 collision).- Individual issue: DXF reader treats MTEXT column width as Common.ltscale (group 48 collision) #2247.
dxf::extended::mtext_columns
-
A10 — MTEXT columns disappear through DWG. The R2007 witness changes a three-column static definition to
None. This is separate from A9's shared-group interpretation.- Individual issue: DWG round trip drops an MTEXT static-column definition #2248.
dwg::extended::mtext_columns- Related feature work feat(text): MTEXT columns, bullets/numbering, tabs and indents, FIELD/UPDATEFIELD, SPELL; in-place editor (gaps.md F9) #532; this is a preservation regression, not a request for another columns UI.
-
A11 — Closed fit spline reopens as open through DWG. The R2000 witness loses
closed=trueand changes the spline's knot/control representation.- Individual issue: DWG round trip reopens a periodic closed fit spline as an open spline #2249.
dwg::extended::closed_fit_splines
-
A12 — DWG consumes a space following an MTEXT caret. Literal
^ Creopens as^C.- Individual issue: DWG round trip consumes literal whitespace following an MTEXT caret #2250.
dwg::extended::mtext_carets
-
A13 — DWG decodes literal Unicode/MIF escapes again. Authored literal
\U+0041 \M+183A4 \P %%cbecomesA Ζ \P %%cin the first witness. The DXF counterpart preserves the literal input.- Individual issue: DWG round trip decodes literal Unicode and MIF escape text a second time #2251.
dwg::entities::text_literal_escapes
-
A14 — DWG current layer resets. Header
CLAYER="Survey_Ä"becomes"0"(R2000 witness).- Individual issue: DWG save/reopen resets the current layer CLAYER to 0 #2252.
dwg::extended::header_current_layer
-
A15 — Native DWG complex-linetype rotation has the wrong magnitude. An authored pi/2-radian rotation is read from the native DWG object as
0.027415567780803774radians. The self-round-trip can pass because bridge directions share an angle interpretation. The native mismatch is reproduced; the precise conversion layer and conflicting public descriptions of DXF LTYPE group 50 still need investigation. Do not “fix” it by loosening angle comparisons.- Individual issue: Native DWG complex-linetype rotation has a radians/degrees magnitude mismatch #2253.
dwg::conformance::complex_linetype_rotation_is_correct_in_native_objects
-
A16 — DXF writers emit oversized hex chunks. Review of test(io): add independent DXF/DWG conformance and preservation matrices #2237 found that the exact-tag round trip accepted oversized ASCII payloads. Independent wire checks now reproduce one 256-character ASCII value and one 128-byte binary chunk for a 128-byte input (group 310,
utf8=false). The public group-code reference limits groups 310–319/1004 to 127 payload bytes; the binary length byte's 0–255 capacity is a framing capability, not an explicit exception. No external-reader rejection is claimed.- Individual issue: fix(dxf): hostile-input hardening in the DXF reader and writer (NaN reals, BOM/CR lines, mixed encodings, hex and integer groups) #1025 (existing report, item 7; additional evidence and specification links).
- Reproduce both pending checks:
cargo test -p cadcraft-dxf --test hex_chunks -- --ignored. - Tests:
ascii_writer_splits_large_payloads_into_conforming_chunksandbinary_writer_splits_large_payloads_into_conforming_chunksin hex_chunks.rs. They check chunk bounds, codes, complete payload reassembly/order and following-record framing without CADCraft's parser as the output oracle. - Passing controls cover conforming output up to 127 bytes and separately test tolerant binary reading of every length-byte value 0–255. The two failing writer checks remain ignored; no production fix is claimed. At the review follow-up head, full local CI passes all seven stages: 2,782 passed, 30 skipped (29 pending checks from this PR plus one pre-existing skip).
B. Observed changes requiring an explicit preservation contract
These findings began as reproduced differences requiring investigation; not every difference establishes geometric/content loss. B2 and B3 now have additional evidence of placement/editing defects. Decide the intended contract before changing either the implementation or expectations; do not blanket-normalize the first save.
-
B1 — Missing justified TEXT alignment point moves text through DWG. Contract settled: ordinary implicit anchors become explicit without changing placement/edits; Aligned/Fit without a second endpoint is refused. Fix fix(io): preserve implicit TEXT anchors in DWG output #2306 awaits merge. This is separate from DWG TEXT's single-elevation limit.
- Individual issue: Decide DWG export semantics for justified TEXT without a second alignment point #2254.
dwg::entities::text_alignment_without_points
-
B2 — Multiline ATTRIB metadata corrupts TEXT justification and subsequent legacy placement. Left becomes Center; embedded MTEXT still looks correct, but subsequent R2000 export moves the single-line fallback. Preserve absence and justification. Both independent regressions pass experimentally with the existing dxf: mirrored entities keep extrusion -Z; unchanged dimension text survives a save (FF1) #1942 reader hunk; keep them pending until that fix lands. Review coverage:
ed37a1c8.- Individual issue: DXF multiline ATTRIB changes Left to Center and shifts subsequent legacy export #2255.
dxf::extended::multiline_attributesdxf::attributes::legacy_placement_is_independent_of_an_intermediate_modern_save- Existing multiline reader fix: dxf: mirrored entities keep extrusion -Z; unchanged dimension text survives a save (FF1) #1942 (hunk experimentally validated); test(io): expand attribute justification round-trip coverage #2224 covers related vertical justification, not this multiline collision.
-
B3 — WIPEOUT closure is valid, but grip editing detaches the closing point. An explicit closing marker is permitted; both representation checks are enabled in test(io): add independent DXF/DWG conformance and preservation matrices #2237 at
9928c8a2. The behavioral regression isA,B,C,A -> A',B,C,Awhen moving the first grip after reopening. Production fix fix: keep WIPEOUT closure coherent across grips and outlines #2284 centralizes closure-aware vertices, edits and outlines, with six-version engine regressions and open/closed polyline controls. Keep this finding open until the fix lands.- Individual issue: WIPEOUT grip editing detaches the explicit closing point after DXF/DWG roundtrip #2256.
dxf::extended::wipeout_implicit_closuredwg::extended::wipeout_implicit_closure
-
B4 — Anonymous dimension cache renumbering is permitted. Resolved in Decide DWG identity preservation for authored dimension cache blocks #2257: Autodesk documents that numeric suffixes may change between sessions, and ODA shows a stored
*Dprefix. PR test(io): add independent DXF/DWG conformance and preservation matrices #2237, commitc525db15, enables the corrected six-version/two-save test. It follows dimension references and strictly checks authored cache contents, handles, properties and block counts, with mutation tests against missing/swapped/merged references. The test correction is pushed, not yet merged; no production fix is claimed.- Individual issue: Decide DWG identity preservation for authored dimension cache blocks #2257.
dwg::extended::dimensions
Not failures to “fix” by expanding the format
The suite already gives explicit expectations/version domains for known representation limits: R2000 DWG has no true-color/transparency fields; native DWG TEXT has a single elevation for its two XY points; block metadata and other newer fields have explicit version gates. Do not turn those limits into blanket tolerances or treat them as additional defects in this list.
Coverage follow-up from review
- Add an independently authored text-placement expectation for alignment × mirrored style. The present generator uses the same font-layout helper as the writer to construct consistent inputs: it proves preservation, not independent geometric correctness. Existing DWG: TEXT with M or bottom (BL/BC/BR) justification is drawn off its alignment point in AutoCAD, also with TrueType fonts #2229 contains separate external-app evidence about other TEXT placement discrepancies; this suite neither reproduces nor resolves that report.
Completion criteria
For each finding, link the fixing PR (or existing issue), run the exact regression plus passing neighboring families and supported versions/encodings, and remove the corresponding ignore when its intended contract is satisfied. For B1–B4, record why the chosen representation is correct and test reference integrity/geometry where canonicalization is allowed. Keep refusal explicit for cases that cannot be saved safely. Leave this tracker open until every listed check has a reviewed disposition.
Activity
ticket-craft commentedon Oct 27, 2026
Thanks! This ticket describes several separate problems:
It helps a lot if each one has its own ticket, so they can be tracked and fixed separately.
Possibly related: #528, #941 and #223.
jonascloud commentedon Oct 27, 2026
Split complete in response to the request above:
The tracker remains open. Creating the individual tickets does not resolve their findings or enable the ignored tests. The independent text-placement coverage follow-up remains listed separately in the tracker.
[-]DXF/DWG preservation: track 27 failing checks, data loss and unresolved contracts[/-][+]DXF/DWG preservation: track 29 failing checks, data loss and unresolved contracts[/+]test(io): compare DWG dimension blocks through their references
[-]DXF/DWG preservation: track 29 failing checks, data loss and unresolved contracts[/-][+]DXF/DWG preservation: track 28 pending checks, data loss and unresolved contracts[/+]test(io): specify WIPEOUT explicit closure on roundtrip
[-]DXF/DWG preservation: track 28 pending checks, data loss and unresolved contracts[/-][+]DXF/DWG preservation: track 26 pending checks and round-trip follow-ups[/+]test(io): expose multiline ATTRIB alignment corruption
test(io): separate ATTRIB value and legacy-placement guarantees
[-]DXF/DWG preservation: track 26 pending checks and round-trip follow-ups[/-][+]DXF/DWG preservation: track 27 pending checks and round-trip follow-ups[/+]assamaral commentedon Oct 28, 2026
ZWCAD 2025 (Windows 11) cross-check of the split issues, each with a minimal synthetic ezdxf drawing →
cadcraft-cli convert(main 5654240 + #2333 fix) → ZWCAD OPEN + DXFOUT, groups compared with ezdxf against a control; details in each issue.$PSTYLEMODE0→1 too)$CLAYER→ 0, ASCII name too)fix: keep WIPEOUT closure coherent across grips and outlines (#2284)
test(io): add independent DXF/DWG conformance and preservation matric…