Repository navigation
ci(corpus): measure the reader on public drawings fetched by pinned hash - #225
Merged
Merged
Conversation
A Corpus job in ci.yml fetches 98 public files (49 DWG, 49 DXF) from nextgis/dwg_samples and DomCR/ACadSharp at pinned commits, verifies each against its pinned size and sha256 (tools/corpus/pins.tsv), runs the five real-file test suites that skip without a corpus on the 19 drawings they are written for, and measures every pinned DWG with coverage_report, probe_class_census and probe_reference_closure against a per-file baseline that must match exactly (tools/corpus/baseline.tsv). A mismatched file fails the job; an unreachable host is reported as NOT MEASURED. measure.yml builds any ref and a base and reports the difference on the same corpus, by dispatch or on a PR that changes the measurement. sample_AC1032.dwg, the corpus's R2018 drawing of unrecorded origin, is byte-identical to DomCR/ACadSharp samples/sample_AC1032.dwg at c30a97ce (MIT, AutoCAD 2025 SAVEAS output); CLEANROOM.md records both sources. coverage_report gains --tsv and prints every type in its histograms.
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: f3edbc301d
ℹ️ 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".
…pins, keep Measure running past an unmeasurable base
This was referenced Oct 26, 2026
Open
DrunkOnJava
enabled auto-merge (squash)
October 26, 2026 09:13
4 tasks
# Conflicts: # .github/workflows/ci.yml
This was referenced Oct 26, 2026
Open
DrunkOnJava
enabled auto-merge (squash)
October 26, 2026 09:56
… the job's time limit Every request's timeout and back-off is cut to an overall --deadline (900 s by default), and once three files in a row are unreachable the rest are reported unreachable without being requested. Before, an empty cache behind a host-wide outage made 588 timed-out requests (about 9.8 hours), so the job hit its 40-minute limit and the required check failed instead of reporting NOT MEASURED. Measured with the real CLI against an empty --dest: - proxy refusing connections: exit 69 after 36 s, 3 files tried, 99 not requested - proxy black-holing connections, --deadline 20: exit 69 after 20 s - normal network: 102 of 102 pinned files verified, exit 0, 25 s
Merged
5 tasks done
5 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Oct 26, 2026
DrunkOnJava
added a commit
that referenced
this pull request
Oct 26, 2026
…es (#246) * feat(streaming): bounded, resumable LZ77 decoder for R2004-family pages Lz77Decoder decodes one §4.7 stream from any prefix of its compressed bytes into an output slice of any size, and can pause between any two calls. Its only page state is a fixed 0xC000-byte window: with the crate's measured distance rules (+0x4000 for 0x10-0x1F, +1 otherwise, bit 3 of 0x12-0x1F as distance bit 14) no back-reference reaches further, so no page, including a system page with no declared cap, needs more. The declared decompressed size is a hard ceiling; reserved opcodes, distances before the first byte, overruns and streams cut before 0x11 are typed terminal errors. It compiles in the no_std, no-allocator kernel natively and for wasm32, bounded at WINDOW + 128. Lz77Checkpoint carries the opcode cursor, pending run, totals and the last min(produced, 0xC000) output bytes under a CRC-32; restore checks length, version and CRC before copying and then requires a reachable state. stream_lz77 decodes every compressed page of an R2004-family file (page map, section map, every LZ77 data page). verify_lz77.py runs it on the four canonical R2004-family fixtures and every R2004, R2010 and R2013 file in the pinned nextgis/dwg_samples commit: 25 files, 266 pages, 6,097,392 bytes, equal to lz77::decompress and to an independent Python parse (length, CRC-32, bytes consumed through 0x11). Fixed and proptest schedules down to one byte in and out reproduce the output; fresh-process resume inside the largest data page leaves no source byte read twice and no output duplicated; corrupt, truncated and resealed checkpoints and four stream corruptions end in their named errors. It runs in the required Streaming E2E job. Every AutoCAD-written page decompresses to its declared size and every stream ends 11 00 00; the crate's writer does neither (recorded on #163). Refs #205, #207 * fix(streaming): typed error, not overflow, for a forged LZ77 input count A CRC-valid decoder checkpoint may carry any consumed count; restore only required it to be non-zero. The next literal or opcode byte then added to it unchecked: a panic in debug builds, a wrapped input position in release. consumed is now accumulated with checked_add before any state moves, and the overflow is StreamError::CounterOverflow, terminal like every other decoder error. Audit of every restored counter: produced cannot pass its limit, since restore and each transition keep every pending run within limit - produced; acc is saturating and bounded by the limit; count and distance are bounded by consistent(). The walk cursors are bounded by consistent() against the verified u32 locators, and both header parsers are rebuilt by replay. stream_lz77 gains --decode-checkpoint <path> --input <hex>, which feeds a restored decoder directly, and its own resume check no longer trusts the caller file's counters. verify_lz77.py now forges consumed = 2^64 - 1 in a literal run and at an opcode (both end in CounterOverflow, with no panic) and decodes a literal run that ends exactly at a limit of 2^64 - 1. Reported by the review on #246. * docs(streaming): the R2018 sample is now pinned by #225, not local only
This was referenced Oct 26, 2026
Merged
Merged
Merged
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
CI now reads real drawings: a
Corpus (public DWG)job fetches 102 public files by pinned sha256, runs the five real-file test suites that used to skip, and ratchets every drawing's measurement against a committed per-file baseline;measure.ymlcompares any ref against a base on the same corpus. It also settles wheresample_AC1032.dwgcomes from.Closes #96. Closes #154. Part of #94: #95 (the job is here; it becomes required once the live ruleset lists it, see below), #97 (README/STATUS numbers follow in a second PR that cites this job's run on
main) and #98 (dispatch is verified after merge, since a new workflow can only be dispatched from the default branch).What changed
tools/corpus/pins.tsv: one registry row per file: repository, commit, path, licence, authoring application, release, kind, size, sha256, git blob id, DXF twin, and whether the legacy tests use it. 42 DWG and 42 DXF fromnextgis/dwg_samples@ff05d5a8(AutoCAD 2016, no licence stated); 10 DWG and 8 DXF fromDomCR/ACadSharpsamples/@c30a97ce(MIT): the R14 to R2018 saves of one drawing with their ASCII DXF exports (AutoCAD 2025), plus three more R2018 drawings,geoloc.dwgwith its DXF andempty.dwg(AutoCAD 2023) andexport_sample.dwg(AutoCAD 2025). Nothing is committed.tools/corpus/fetch.py(stdlib only): downloads each file at its pinned commit from raw.githubusercontent.com, falls back to the git blobs API by blob id, retries each route, and keeps a file only if its size and sha256 match. Exit 0 verified, 1 mismatch or the commit no longer serves the file (fail closed), 69 host unreachable (the job reports NOT MEASURED). Its layout is<dest>/<source>/<file>, DXF twins alongside, so the DXF value oracle (Epic: AutoCAD's own DXF export as the value oracle #99) can read the same tree.--legacy-samplescopies the 19 drawingstests/samples.rsand its siblings are written against to../../samples.--cross-checkfails the job unless every file atools/streaming/*-corpus.jsonmanifest names is pinned here with the same size and sha256, so the streaming E2E's copies of nextgis pins cannot drift; folding those manifests onto this registry is a follow-up after the streaming PRs land.tools/corpus/measure.py:runexecutescoverage_report --tsv,probe_class_censusandprobe_reference_closureon every pinned DWG;checkcompares each file's decoded / skipped / errored / walk skips / handle mismatches / class-census shortfalls / inter-record bytes / decoded, unanswered and hard references withtools/corpus/baseline.tsvand fails on any difference, labelled REGRESSION or IMPROVED OR NEW (a change that moves a number commits the regenerated baseline in the same PR; the job uploads the proposedbaseline.tsvas an artifact);diffandreportwrite the Measure summary..github/workflows/ci.yml: thecorpusjob (corpus cached by the hash ofpins.tsv; the real-file tests fail if any of them printsskipping)..github/workflows/measure.yml:gh workflow run measure.yml -f ref=<ref> -f base=mainbuilds both refs in one job and writes per-release, per-file and per-type differences to the summary; also runs on PRs that touch the measurement. Artifacts hold JSON and logs (corpus paths replaced by<corpus>), never a sample file. DXF oracle scores: NOT MEASURED until Epic: AutoCAD's own DXF export as the value oracle #99 lands.examples/coverage_report.rs:--tsv <path>(per-file counts and per-file, per-type error and unhandled rows) and histograms that name every type instead of the top 10 / 15.CLEANROOM.md: a "Public corpus" entry with both sources' licence, provenance and status; the allowed-sources bullet no longer says nextgis's terms permit redistribution (it states no licence).CONTRIBUTING.md: the fetch / measure / baseline commands replace the hand clone..github/rulesets/main-protection.json: addsCorpus (public DWG)to the required checks. The live ruleset is not changed by this PR.Findings
sample_AC1032.dwgis ACadSharp's (Establish the provenance of sample_AC1032.dwg, the one R2018 file #96): 1,081,979 bytes, sha2560e8faaca…b528, git blob4cfa790d6719acf3aad9818bacbd693ac3ab71b8, the blobsamples/sample_AC1032.dwgholds atc30a97ceand on ACadSharp'smastertoday. ACadSharp'ssamples/sample_base/save_samples.lspsaves one base drawing through AutoCAD'sSAVEASas R14 to R2018 DWG and as ASCII DXF, and every R2004+ file'sAcDb:AppInforeadsbuild_version="V.162.0.0(x64)" registry_version="25.0". So the corpus now has the same drawing in seven releases, each with AutoCAD's DXF export except R14.sample_AC1009_ascii.dxfwith the ANSI_1252 byte0xD8re-encoded as UTF-8C3 98(596,017 bytes against the pinned 596,016), and the pin rejected it. That is why the routes are raw.githubusercontent.com and the git blobs API.export_sample.dwgerrors on 9 VIEWPORT, 4 TEXT and 1 HATCH records, the first TEXT and HATCH errors seen on R2018;geoloc.dwgdeclares 2 GEODATA and 1 AcGeoBackupObject and the walk reaches 1 and 0 (closure closed), and its 1 GEODATA has no decoder.ACDB_TEXTOBJECTCONTEXTDATA_CLASSis declared twice and walked zero times on ACadSharp's R2004 and R2007 saves, whileprobe_reference_closurefinds both walks closed: a class-table over-declaration of the kind DICTIONARYVAR / CELLSTYLEMAP under-walk on R2004/R2007/R2010 (18 entries across 9 files) — pre-existing, now pinned by the census ratchet #76 settled, pinned in the baseline.Spec reference
No decoder change. Measurement only.
Test plan
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings: clean.actionlinton both workflows: no finding in the new jobs.98 of 98 pinned files verified (98 downloaded), 19 legacy files copied. Every downloaded file's git blob id equals the one in its commit's tree.https_proxy): exit 0,0 downloaded.::error::naming each.samples23,r2013_entity_values15,block_names5,corpus_roundtrip5,class_census1, all passed, and no line containsskipping.measure.py runover 49 drawings: 0 measurement failures;checkpasses against the committed baseline; a baseline with one decoded count raised, one census entry raised, one errored count raised, one row removed and one ghost row added fails with each named as REGRESSION or IMPROVED OR NEW.measure.py diffon a base with 29 TEXT errors added to one file reports +29 decoded / -29 errored on R2004 and the TEXT row.Corpus (public DWG)job on the first commit, on GitHub's runners (run 40296787615): 98 of 98 verified (restored from the cache the Measure job saved), the five suites passed (49 tests) with noskipping, every one of 49 baseline rows matched.--cross-checkwith main'sheader-corpus.jsonand thewalk-corpus.json/lz77-corpus.jsonon the streaming branches: all 37 entries agree; a manifest with one sha256 changed fails with the file named.Corpus (public DWG)and Measure jobs on the second commit (linked below).Measured on
943eaebplus this branch:The 24 nextgis drawings never measured before (ellipse, point2d, point3d, polyline2d_line in six releases) decode with 0 errors: 4,208 decoded / 632 skipped. They are gated like the rest.
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).dwg-rsis Apache-2.0 and must remain compatible.My contribution is based on:
CLEANROOM.md.Disclosure: from
DomCR/ACadSharp(MIT) only data was read: its sample DWG and ASCII DXF files,LICENSE, the commit history ofsamples/sample_AC1032.dwg, andsamples/sample_base/save_samples.lsp(an AutoCAD command script with no DWG or DXF implementation), to establish provenance. No ACadSharp source code was opened. Recorded inCLEANROOM.md.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.