Repository navigation
test(code_page): prove decode then encode returns the bytes read on the pinned double-byte drawings (#375) - #414
Merged
Merged
Conversation
…he pinned double-byte drawings (#375) probe_code_page decodes every string of every pre-R2007 drawing and encodes the text back: Shift_JIS 21 of 21 strings return their bytes, GBK 12 of 12 (4 more hold an invalid sequence, the non-text BLOCK_HEADER descriptions of #386, and are counted, not encoded). The probe fails when a string that decodes cleanly encodes to other bytes.
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. |
# Conflicts: # ARCHITECTURE.md
DrunkOnJava
enabled auto-merge (squash)
October 27, 2026 22:21
DrunkOnJava
added a commit
that referenced
this pull request
Oct 27, 2026
… and the double-byte round trip (#414) landed
4 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
…10-27 (#416) * docs: bring README, ROADMAP and CHANGELOG up to the landings of 2026-10-27 README's code-page and DXF writer text named work in review that has landed (#371, #380, #382, #384); jev_review.py prose ranked those sentences 0.72 to 0.96. ROADMAP's "where it stands" table was a 2026-10-21 snapshot whose numbers, CI row and release row were all out of date; it now points to the rendered numbers instead of repeating them. CHANGELOG gains #371, #380, #382, #384, #385 and #404. * docs(changelog): record the CI-only merge train (#408) * docs: OBJECTS landed (#372): README, ROADMAP and CHANGELOG * docs: LAYOUT, GROUP and MLINESTYLE (#373), the class map writer (#405) and the double-byte round trip (#414) landed * docs: VISUALSTYLE landed (#413) * docs(readme): name the skipped types still in review without per-type counts; MATERIAL landed (#325) * docs(readme): point to the open decoder PRs instead of a list that each landing makes stale
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 double-byte round-trip proof #375 asked for after #382 and #384:
examples/probe_code_page.rsdecodes every string of every pre-R2007 drawing withCodePage::decodeand encodes the text back withCodePage::encode, and fails when a string that decodes cleanly encodes to bytes other than the ones read. It runs over the pinned Shift_JIS and GBK drawings (header shorts 38 and 39), so every row a later change adds is held to it. The change is the probe check and one ARCHITECTURE.md section; no library code moves.Spec reference
ODA spec v5.4.1 §3.2.5 (the code page short). ARCHITECTURE.md §7av (provisional letter; the train renumbers).
Evidence (
probe_code_pageover the 61 pinned drawings, 2026-10-27; measured on the same probe merged with #382 and #384, before the repository moved its builds to CI; this PR's Corpus job re-runs it on this head and is the gate):ANSI_932, Shift_JIS)ANSI_936, GBK)The 21 Shift_JIS strings are the two Japanese layout names (five two-byte characters and a digit, each as a dictionary entry and as a LAYOUT object name) in the four AC1014 drawings and five more dictionary entries of
3d.dwg; the 12 GBK strings are the two layout names in the same two places. Every string that decodes without an invalid sequence encodes to the bytes it came from, including those whose trail bytes are ASCII letters. The 4 that hold U+FFFD are the four 1,028-byte non-text "descriptions" of the BLOCK_HEADER records that error (#386, the nine errored rows #384's baseline pins): bytes that are not text, counted and not encoded.Why the round trip is exact on the WHATWG encoders:
CodePage::encode_charreturns bytes only when they decode back to the character (#382), which keeps extra mappings such as U+00A5 to 0x5C on Shift_JIS out; none of the pinned strings use them.No decoded, skipped or errored count and no oracle row moves (probe and ARCHITECTURE.md only). README.md and STATUS.md are not touched.
Test plan
cargo fmt --all -- --check,python3 tools/ci/spec_coverage.py --check,python3 tools/maintainer/train/arch.py checkandtools/streaming/check_invariants.pypass locally on this head; per the repository's new rule nothing was built or run on the maintainer's Mac for this head, so clippy, tests, the probe and the Corpus job run in CIprobe_code_pagestep is the repeatSource-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.See
CLEANROOM.mdfor the full allowed/forbidden source list and the honest scope of what "clean-room" means for this project.For this PR specifically: the probe reads only pinned public drawings (CLEANROOM.md, 2026-10-27 entries); no source of any other DWG implementation was read.
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.