Repository navigation
feat(dxf): the value oracle — pair every DWG record by handle and score its fields - #248
Conversation
0385350 to
ac22d04
Compare
ac22d04 to
8096e6c
Compare
8096e6c to
6238915
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62389159ea
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6238915 to
6bdfdc9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6bdfdc90f6
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6bdfdc9 to
adcb535
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adcb53563c
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
adcb535 to
390884b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 390884b1d7
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
390884b to
74f333b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74f333bd6c
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1c10e27 to
59013d1
Compare
59013d1 to
071dfc5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 071dfc5b39
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…re its fields examples/dxf_oracle pairs each corpus DWG with AutoCAD's own DXF export of the drawing (nextgis/dwg_samples and the ACadSharp samples; R14 saves with their R12 export), record by handle (#101), and compares every decoded field with the DXF group that carries it (#102): the spec's DXF column for the types v5.4.1 prescribes, the DXF Reference otherwise. Statuses are equal, default (the export omitted a default-valued group), different, dwg-only and not-decoded; reals agree within half a unit of the 16 significant digits and 16 decimal places AutoCAD prints (finer where a file prints finer, never coarser), plus 4 ulps. Text a pre-AC1021 export holds in an undeclared code page is not compared: the field (or dictionary key) is dwg-only and the group stays not-decoded. An XRECORD's application data, after `100 AcDbXrecord`, is counted group by group, its `100`s and `102`s as data rather than markers or brackets, as the reader reads it. A path option given without its path, an unknown option or a second directory is a usage error, and a baseline that is not the oracle's TSV (wrong header, a short row, a count that is not a number, no rows) fails the run, so a requested ratchet cannot be skipped silently. It prints the pairing and one-sided records by release and type, a field matrix per type, every disagreement, the DXF groups no decoder surfaces and a summary by spec section, and writes a TSV that --baseline ratchets (#103); the baseline is read before any output is written, so --tsv may name the same file. Measured over 49 drawing pairs, R14 to R2018: 46 spec sections paired (44 with decoded fields to compare), 19 values disagree, all filed (#241-#244); the rest agree. The reader keeps pre-AC1021 non-ASCII text as bytes instead of refusing it, and measures the decimal places a file prints reals with. docs/spec-coverage.md says what the oracle measured on each section, written by tools/oracle/spec_notes.py, which replaces only a note's oracle sentence and keeps the "The spec's own example ..." sentence spec_examples --update writes last (#107), so the two can run in either order; LAYER moves to closes (its pre-R2007 values, the subject of #34, equal the export on every release). Refs #99, #101, #102
071dfc5 to
307659b
Compare
Summary
The DXF value oracle:
examples/dxf_oraclepairs every DWG record of the corpus with the record of the same handle in AutoCAD's own DXF export of the same drawing (#101), and compares every decoded field with the DXF group that carries it (#102). A record that closes on its data-stream boundary proves the widths add up; this is the check that says the values are right.One commit on
main: #223 (the reader) and #235, #236 and #238, the three decoder fixes the oracle found, have landed.What it does
.dwgunder the corpus directory with its twin (<name>.dxf, the ACadSharp<name>_ascii.dxf, or nextgis's R14 saves with their R12 export). Reports, per file and by release and type, what pairs, what pairs with a different type, and what one side lacks. Every one-sided record is explained in the example's docs: each save's own round-trip/variable objects (fresh handles above every shared one, markedsave-time), VP_ENT_HDR_CTRL (no DXF record), solid history the R2000/R2004 exports omit, and R12's missing sections.equal,default(export omitted a default-valued group),different,dwg-only,not-decoded; a one-sided field is listed, never counted equal. Reals agree within half a unit of AutoCAD's printing (16 significant digits and 16 decimal places, finer where a file prints finer, never coarser) plus 4 ulps; everything else is exact. Text a pre-AC1021 export holds in an undeclared code page is not compared (dwg-only, its group left not-decoded). The export's own conventions (degrees,^J, the unwritten bit 64, anonymous-block numbering, embedded101objects, true colour) are measured and documented inscorers.rs.--tsv,--baseline(the Oracle results in CI, ratcheted #103 ratchet: fails when a row's agreeing count falls or a baseline row is absent, saying which, so a renamed field needs the regenerated TSV committed with it),--summary(Markdown for a job summary).tools/oracle/spec_notes.pywrites each measured section's note intodocs/data/spec-coverage.tsvfrom the oracle's report (thentools/ci/spec_coverage.py --write), naming the issue a section's disagreements or remaining gap are filed under. It replaces only the note's oracle sentence and keeps theThe spec's own example ...sentence test(fixtures): run the specification's own worked examples through the crate (#107) #280'sspec_examples -- --updatewrites last, so the two can run in either order: on this branch--updatereportsno expect cell changedand leaves the regenerated TSV byte-identical, with all 76 such sentences.DxfValue::CodePageText) instead of refused: ACadSharp's R12 sample declares no$DWGCODEPAGE, so decoding it would be a guess.real_decimals()measures the decimal places a file prints.docs/spec-coverage.md(data and page regenerated bytools/ci/spec_coverage.py --write). LAYER §20.4.54 movespartial→closes: its pre-R2007 field list is checked against the RL boundary and every value equals the export on every release (the subject of R2004 symbol-table field lists are unvalidated past the object header: LTYPE description and LAYER colour/lineweight decode silently wrong #34). No row moves tocomplete: the corpus has no R13 drawing and no R14 export with handles on tables and objects.release-1.0-criteria.mdR3/R4/R8 "measured now" updated; CLEANROOM entry for the scorers' sources.Test plan
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings,RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features,cargo +1.85 check --all-features --all-targets,python3 tools/ci/spec_coverage.py --checkcargo test --release --all-featureswith../../samplespresent: all pass; no test addednextgis/dwg_samplesdrawings atff05d5a8and the ACadSharpsamples/atc30a97ce, each file checked against the ci(corpus): measure the reader on public drawings fetched by pinned hash #225 pins, in the ci(corpus): measure the reader on public drawings fetched by pinned hash #225 fetch layout:Pairing over 49 drawing pairs (R14 to R2018):
Disagreements: 19 values, each filed: VIEW_CONTROL/APPID_CONTROL
num_entriesvs TABLE 70 on the ACadSharp saves (#241), one LTYPE dash shape flag bit 8 (#242), the BLOCK name of a dynamic block's anonymous representation on R2000-R2007 (#243),geoloc.dwg's view height and centre (#244). Before #235, #236 and #238 there were 420 (308 entry-header bits, 84 VPORT, 9 LAYOUT plot flags, and 19 more the scorers' own rules resolved).The ratchet: run against its own TSV it passes; with one baseline count raised by one it fails:
Summary by spec section:
Not decodedcounts DXF groups no decoded field maps to (owner and other handles, layer, colour, linetype on entities, extended data): the work left forcomplete.Unscoredrecords are paired but not decoded, or decoded without a scorer yet (VISUALSTYLE, MLEADERSTYLE, the view styles, DIMENSION, HATCH, SPLINE, MLINE, GROUP and others; #102 stays open for them).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:
CLEANROOM.md).Based on ODA spec v5.4.1 (the DXF column of each §20.4.x table), Autodesk's public DXF Reference (recalled), and AutoCAD's DXF exports in
nextgis/dwg_samplesand ACadSharp'ssamples/read as data; recorded inCLEANROOM.md. No permissively-licensed project's code or comments were read.Developer Certificate of Origin
By submitting this PR, I certify that the contribution complies with the Developer Certificate of Origin 1.1.
Refs #99, #101, #102. Closes #34 (see its last comment for the measurement).