Skip to content

fix(entities): CAMERA, SUN, LIGHT and GEODATA have no fixed type code; their numbers come from the class map (#476) - #489

Merged
DrunkOnJava merged 4 commits into
mainfrom
fix/476-no-fixed-scene-codes
Nov 30, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
fix/476-no-fixed-scene-codes

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

CAMERA, SUN, LIGHT and GEODATA are custom classes: their type numbers come from AcDb:Classes, like every class numbered 500 or above. ObjectType still gave them fixed codes 0x4F8 to 0x4FB, and the dispatcher decoded 0x4FA as LIGHT and routed 0x4FB to GEODATA. In a drawing that declares that many classes, a real class at one of those numbers was therefore labelled, or for LIGHT decoded, as the wrong class (#476).

  • ObjectType::{Camera, Sun, Light, GeoData} and their code mappings are removed; those codes now read as ObjectType::Custom.
  • The dispatcher's fixed-code LIGHT arms (both stream layouts), the GEODATA object arm, their labels and OBJECT_TYPE_LIGHT / OBJECT_TYPE_GEODATA are removed. DecodedEntity::type_code() gives 0 for LIGHT and GEODATA, as it does for other custom classes.
  • All four are still decoded by their class name, through the class map, as every corpus record already was.
  • probe_geodata and the DXF oracle (examples/dxf_oracle/corpus.rs) match the class-map path only, and tools/ci/dispatch_arms.py drops the GEODATA exemption it no longer needs.
  • light::decode and light::decode_modern_split_stream, two wrappers over read_body whose only callers were the fixed-code arms, are removed, and so is geodata::decode, an inline wrapper nothing called. None of the three checked where the record ends; the class-name path reads the same field lists through read_body and does.
  • ARCHITECTURE.md §7aa and a changelog fragment say so.

The crate is unreleased, so removing the four variants breaks no published API.

Closes #476.

Testing

  • dispatch_arms.py --check (41 decoded codes, all labelled), spec_coverage.py --check, changelog.py check and rustfmt pass. CI builds and runs the corpus.
  • Every corpus record of these classes carries a class number, so the corpus should not move. Measure run 46372107389, on the final head 24bc1c43 merged into main, confirms it: 495,272 records decoded on both sides, 40 skipped, 0 errored, with no per-file or per-type change.

Source provenance

No format work: the fixed codes are removed, and the classes keep their class-map decoders.

@DrunkOnJava
DrunkOnJava merged commit 0a75e6a into main Nov 30, 2026
29 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/476-no-fixed-scene-codes branch November 30, 2026 07:28
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.

Fixed type codes 0x4F8 to 0x4FB for CAMERA, SUN, LIGHT and GEODATA can label real custom classes

1 participant