Skip to content

Civil: read the point databases the application writes (W1-5) - #655

Merged
HakanSeven12 merged 1 commit into
hakanaktt:mainfrom
schoeller:w1fix/w1-5-cogo-survey-tree
Nov 24, 2026
Merged

HakanSeven12 merged 1 commit into
hakanaktt:mainfrom
schoeller:w1fix/w1-5-cogo-survey-tree

Conversation

@schoeller

Copy link
Copy Markdown
Contributor

D016 wave-1 packet-1 gap W1-5 (+ D017 packet-2 W2-1), corpus-roundtrip context

cogo_points() returned 0 of 538 AECC_COGO_POINT records in Survey-3.dwg and 0 of 2405 in Points-4a.dwg. The codec's own write path was bit-exact; this was a READ-side hole — and probing showed it was not survey-specific: every application-written point database decoded to 0 (28 tutorial files, 53,521 entities).

Root cause (two record-form differences, both read-side)

  1. Per-record marker short. The reader required exactly 0x0420 (what this crate writes). The application writes 0x0421 — and 0x0621 for points a survey created. Observed over the whole tutorial corpus: 53,190 × 0x0421, 1,614 × 0x0621, no other form; the record layout does not change with the flag bits. The reader now masks the observed flag bits and keeps the 0x0420 base check.
  2. Leading tagged list. After the styled/labelled lists the application writes a further tagged list (BL jA, jA × { BL number, BL text tag }) where the crate expected a literal BL 0 and failed on any non-empty one. String-stream arithmetic confirms the field in every sample: strings = "" + jA texts + names + names (2nd copy) + raw descriptions + slot texts (Points-2: 1+51+2405; Profile-5C: 1+2+2×1525+1525; Survey-3: 1+538; Intro-2: 1+2×2405+2405). Its semantics are not mapped yet (its texts are not PointName — the application reads name=[] for those points), so the list is consumed structurally and kept out of the API (graceful-None ruling). This crate's records place an empty list there, so the writer is unchanged and its files read as before.

Verification

  • Corpus census gate: 53,521 / 53,521 points decode across all 28 tutorial drawings with COGO points (Survey-3 538/538, Points-4a 2405/2405, Points-4e with user-defined-property slots 2405/2405).
  • Semantic gate vs the live application (execute_civil_code CogoPoint.Easting/Northing/Elevation, readOnly, 2026-11-24):
    • Survey-3 pt 456: E=5675.002124308634 N=5040.000833228553 Z=255.95998686447933, raw="TC1" — exact to the last digit; pt 816 exact; pt 304 exact.
    • Points-4a pts 1/2/3 (D017 packet-2 oracle): E=19857.2577 N=20260.4556 Z=100.3058 etc. — exact, names empty as decoded.
    • Points-2 pts 48/368/392/534/1840: raw descriptions POND/CLRD/BOTB from the described list, names empty — as decoded.
    • Profile-5C pts 110/111/968: names "110"/"111"/"968" from the named list — as decoded.
  • Full suite green: 3303 passed / 0 failed (with ACADRUST_CIVIL_TUTORIALS_DIR set; re-run green on the rebased tip 483de92).

Tests

tests/civil_read_cogo_points_app.rs: the survey-created form (Survey-3, 538 points, marker 0x0621) and the create-points form (Points-4a, 2405 points, marker 0x0421, 51 label styles) with exact live-API positions; census on Points-2/3/4e/Survey-2B; crate-written records unchanged (existing rt_data_cogo_points suite).

D016 packet-1 gap log: W1-5 (Survey-3 538/0); D017 packet-2: W2-1 (Points-4a 2405/0). Closes the READ gap for the whole family; the corpus-roundtrip branch builds Survey-3's manifest from these records.

The point database reader decoded no application drawing: it required the
per-record marker short to be exactly 0x0420 (this crate's records) where
the application writes 0x0421, or 0x0621 for points a survey created, and
it expected an empty list where the application's records carry a leading
tagged list before the named points. Both forms are documented and read;
this crate's own records keep an empty leading list, so its writer is
unchanged and its files read as before.

Over the whole tutorial corpus this is 53,521 of 53,522... (continued)

Full message in PR body.
@HakanSeven12
HakanSeven12 merged commit bf911de into hakanaktt:main Nov 24, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants