Repository navigation
fix(objects): decode LAYOUT on R14, R2000 and R2007 with §20.4.84's version branches (#229) - #270
Merged
Merged
Conversation
…ersion branches (#229) §20.4.84 gives LAYOUT and its plot-settings block a TV plot view name on R13-R2000 and the shade-plot fields and viewport count from R2004; the decoder refused those bands instead of reading them, R2007 on the stale ground that its string stream could not be located, and on R14 and R2000 LAYOUT carries a class number dispatch never routed. All 75 R14, R2000 and R2007 LAYOUT records of the public corpus were skipped. Read as printed and routed by class name, all 75 close, and each equals the R2004 save of the same drawing handle by handle, apart from the fields a release does not store. The three unit tests that pinned the refusal are removed. ARCHITECTURE.md §7s records it; §20.4.84 moves to closes.
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. |
10 tasks done
# Conflicts: # ARCHITECTURE.md # docs/data/spec-coverage.tsv # docs/spec-coverage.md # tools/corpus/baseline.tsv
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.
Summary
Decode LAYOUT (and the PLOTSETTINGS block it embeds) on R14, R2000 and R2007. This PR reads §20.4.84's R13-R2000 and R2004+ branches, routes the R14/R2000 class number, and drops the stale R2007 refusal. All 75 LAYOUT records of the public corpus that were skipped now close, and every one equals the R2004 save of the same drawing, handle by handle. Part of #229.
Spec reference
§20.4.84 LAYOUT (varies) has three branches the decoder refused instead of reading:
Tplot view name (6), after the plot windowBSshade plot mode, resolution level and custom DPI (76-78)BL, §7d.2)R2007 was refused on the grounds that its string stream could not be located, which #65 fixed. On R14 and R2000 LAYOUT has a class number from AcDb:Classes rather than
0x52, so this PR also adds aLAYOUTarm todispatch_object_class.check_versionis removed.AcadPlotSettingsgainsplot_view_name(empty from R2004). The shade-plot fields andviewport_countread 0 where the record does not store them, and the docs say so.Records it was measured on
R14 and R2000 have no DXF twin in the corpus; R2007 does, but the comparison here is against R2004.
examples/probe_cross_release.rs(#264, which merges first) compares each record with the R2004 save of the same drawing, the band whose list §7d.2 measured, ignoring only fields a release does not store:trailing_strings, the string-stream residue)On R14 and R2000 the comparison ignores the shade-plot fields and
viewport_count. They are also compared with the plot view name included: it is empty on every record and equal, so it is measured only as an emptyTV.Coverage,
../../samplescargo run --release --example coverage_report -- ../../samples:Public corpus:
tools/corpus/baseline.tsv(regenerated, committed)Twenty-four rows move: every R14, R2000 and R2007 drawing gains 3 decoded and loses 3 skipped (4 for ACadSharp's). The 52-file total goes from 13781 / 1985 / 308 to 13856 / 1910 / 308.
measure.py checkpasses. The R14 rows overlap #254, #264 and #267, so this is regenerated in the serial rebase.Class census and reference closure
Unchanged on all 19 files of
../../samplesand in the baseline's census and closure columns.Docs
docs/data/spec-coverage.tsv§20.4.84 →closes;docs/spec-coverage.mdregenerated.acad_layout.rsandacad_plot_settings.rsare updated.Test plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningsRUSTFLAGS="-D warnings" cargo test --release --all-features(real-file tests ran against../../samples)RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-featurestools/corpus/measure.py checkpasses against the committed baselineacad_layout::tests::rejects_the_undetermined_release_bandsandacad_plot_settings::tests::rejects_the_undetermined_release_bandsasserted that R14, R2000 and R2007 are refused.entities::dispatch::tests::undetermined_layout_release_is_unhandled_not_errorasserted that an R2000 LAYOUT comes backUnhandledas undetermined. The corpus disproves that: all 75 records of those bands now close and equal their R2004 saves.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).My contribution is based on §20.4.84 of the ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1) and on the corpus bytes. No third-party 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.