Repository navigation
feat(dxf): score HATCH in the value oracle (§20.4.75) - #389
Merged
Merged
Conversation
The HATCH decoder is now compared with AutoCAD's export field by field. The export writes the groups in the order the spec prints them, so they are scored in that order, each within the next few groups of the record, which checks the order as well as the values: the elevation as the z of the dummy point 10, the extrusion, name, solid and associative flags, the path count, each path's flags with its vertices or line edges and its boundary handle count (97), the hatch style and type, the pattern block (angle, scale, double flag, each line's angle, base point, offset and dash lengths), the pixel size of a derived path, the seed points and the gradient block (450 to 470). Paths, edges and pattern lines are scored under one field name each. A gradient colour is a CMC word: the DWG keeps the method byte 0xC2 and the RGB, which is group 421; group 63, the ACI AutoCAD derives from the RGB, is not stored (the BS beside it is 0) and stays not-decoded. On the 49 drawing pairs: 48 records, R2000 to R2018 (8 per release; 3 of each hold a polyline path and 5 line edges, 10 hold a gradient), 23360 values equal the export, none differ, 20 decoded values have no DXF group (the colour BS that is always 0). Only line edges and polylines occur in a file with a DXF twin, so arc, ellipse and spline edges stay unscored, and the section stays partial. tools/oracle/baseline.tsv gains the 278 new rows, and the §20.4.75 row of docs/spec-coverage.md says what the oracle measured. The oracle's section map files HATCH under §20.4.75. Refs #99, #102, #147
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. |
2 tasks done
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de1773d4b0
ℹ️ 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".
An arc, ellipse or spline edge was recorded as not scored but its DXF groups were left in place, so every later edge, the boundary-handle count and the pattern fields were compared against the wrong groups. The scorer now ends the record there, noting that the rest is not scored. The corpus holds only line edges and polylines, so no measured count changes.
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
* fix(ci): hold a stacked PR until the older PR it builds on lands A PR stacked on an older open PR targets main but holds that PR's commits. When the train held the older PR on a review thread it went on to the next one: landed first, that PR would have carried the older one's work into main under its own title (#337 over #335, #339 over #337 were drafted by hand to stop it), and its refresh merged main over the older PR's commits, so after that PR landed its merge base no longer applied and a lane had to merge it by hand. The train now sends such a PR to the end of the queue while an older open PR (a lower number) shares commits with it that main does not have. On the queue of 2026-10-28: #324 waits for #323, #355 for #324, #356 for #355, #410 for #356, #412 for #410, #339 for #337 and #341 for #339; #323, #337, #389 and #296 wait for nothing. * fix(ci): check every open PR, skip landed work, and defer on a failed lookup The stack check listed at most 200 open PRs, only those targeting main, treated any shared commit as outstanding even when it belonged to a PR that had already landed by squash, and let a PR through when a fetch or gh call failed. It now fetches every PR head to refs/train/pr/<n> in the main clone, pages through all open PRs whatever they target, ignores a shared commit that a merged PR's head holds, and returns 2 on any failed lookup, which sends the PR to the end of the queue. Checked in a scratch repository (two PRs built on a landed PR do not wait for each other; a PR built on another waits for it; a failing gh returns 2) and on the live queue, where the R13 and unp stacks give the same order as before. * fix(ci): count only PRs merged into main as landed when checking a stack A PR merged into a feature branch has merged_at set too, so its commits were treated as landed and a newer PR holding them went ahead of the open PR they were waiting in. The exemption now takes only PRs whose base is main. All 187 merged PRs so far target main, so the live order is unchanged.
# Conflicts: # README.md # STATUS.md
DrunkOnJava
enabled auto-merge (squash)
October 28, 2026 08:30
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
The value oracle scores HATCH (§20.4.75) against AutoCAD's DXF export: 48 records, R2000 to R2018 (8 per release).
The export writes the groups in the order the spec prints them, so the oracle scores them in that order, each within the next few groups of the record. A group out of place then shows as a missing one, and the order is checked along with the values: the elevation (the z of the dummy point 10), the extrusion, the name, the solid and associative flags, the path count; per path its flags, its vertices (72, 73, 93, 10/20) or line edges (93, 72, 10/20, 11/21) and its boundary handle count (97); the hatch style and type; the pattern block (angle, scale, double flag, and per line the angle, base point, offset and dash lengths); the pixel size of a derived path; the seed points; and the gradient block (450 to 470). Paths, edges and pattern lines are scored under one field name each, so a 232-line pattern adds no rows.
Spec reference
Spec §20.4.75 HATCH. Before and after, on the 49 drawing pairs:
Per release: 5 hatches with line edges and 3 with a polyline path (flags 7, which also carry the pixel size), and from R2004 two with a gradient. No field comes out different.
A gradient colour is a CMC word. The decoder keeps the method byte 0xC2 and the RGB (0xC20000FF for blue); the export's 421 is the RGB alone, so the oracle compares the word's 24-bit payload when the method is 0xC2, as it does for VISUALSTYLE. Group 63, the ACI AutoCAD derives from the RGB (5 and 2), is not stored: the BS beside the word is 0 on every record, so that BS is DWG-only (20 values) and the 63s stay not-decoded.
Only line edges and polylines occur in a file that has a DXF twin: the one spline edge of the corpus is in
export_sample.dwg, which has none, and no file holds an arc or ellipse edge. Those edge types stay unscored (the code says so), and §20.4.75 stayspartial.The not-decoded groups are the dummy x and y of the elevation point (10 and 20), the boundary handles (330), the reserved 451, the layer, and the extended data.
tools/oracle/baseline.tsvgains the 278 new rows; no existing row changes (the ratchet against main's baseline passes). The §20.4.75 row ofdocs/spec-coverage.mdsays what the oracle measured.Test plan
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test --release --all-features,RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features,python3 tools/ci/spec_coverage.py --checkSource-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).dwg-rsis Apache-2.0 and must remain compatible.My contribution is based on:
CLEANROOM.md.No such reading was needed: the mapping is the spec's DXF column and the DXF Reference's AcDbHatch groups, read from AutoCAD's own exports as data.
See
CLEANROOM.mdfor 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.
I will sign off commits with
git commit -swhen asked, which adds aSigned-off-bytrailer to the commit message asserting the DCO.Refs #99, #102, #147.