Skip to content

feat(entities): route LIGHT by class name and read it with the layout its R14 record closes on (#152) - #426

Merged
DrunkOnJava merged 5 commits into
mainfrom
feat/light-class-entity
Oct 28, 2026
Merged

DrunkOnJava merged 5 commits into
mainfrom
feat/light-class-entity

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Routes the LIGHT entity by class name, which the dispatcher never did, and replaces the LIGHT field list with one the corpus's only LIGHT record closes on: handle 0x34F of 3d.dwg (kurema/BookViewerApp3, AC1014, 784 data bits). State decoder: the boundary closes, the values are unscored, because that drawing has no DXF export in the corpus.

Spec reference

None: ODA spec v5.4.1 prints no layout for LIGHT. The row in docs/spec-coverage.md ("CAMERA / LIGHT / HELIX", decoder) gains the note; the state does not move. Layout, evidence and what the bytes do not settle: ARCHITECTURE.md §7bq (provisional letter). Method and the no-twin rule: CLEANROOM.md (2026-10-28).

The wiring gap was real, but wiring alone could not close the record. The decoder behind the fixed-code path read LIGHT from R2007 only and with a different field list, so a class-name route to it would only have turned the R14 record into an unsupported skip, or into an error on release R14. Read against the record (text inline), that list ends 395 bits before the boundary. The new list, in the data's own order:

BL version, TV name, BL light_type, B is_on, BS colour, B plot_glyph, BD x7,
BL attenuation_type, B use_attenuation_limits, BD x4, B cast_shadows,
BL shadow_type, BS shadow_map_size, RC shadow_map_softness

closes the record to the bit. The values read as plain numbers: hotspot and falloff of 45 and 50 degrees in radians, attenuation limits 1 and 10, a shadow map of 256; the name's Shift-JIS bytes read as the Japanese for "point light 1", which fits light type 2.

Not settled by the bytes, and said so in ARCHITECTURE.md and the spec-coverage row: how the seven BD after the plot glyph split. They close the record equally as intensity, position, target (taken, as the DXF Reference lists the groups) and as position, target, intensity. Also unverified: the light types 1, 3 and 4, the shadow fields' roles, and the colour form from R2004 (read as the ACSH nodes have it).

Light's public fields change with the list (the position and target are no longer optional, and the colour is a ShColor). The three unit tests that pinned the old list are removed; no test is added.

Expected corpus baseline change: decoded +1, skipped -1, errored 0; the baseline is committed from the Corpus job's artifact.

Test plan

  • cargo fmt --all -- --check, python3 tools/ci/spec_coverage.py --check and python3 tools/maintainer/train/arch.py check pass locally
  • Clippy, Test, Documentation and the Corpus job run on CI only (no local builds)
  • Shown working on real files: the Corpus job's per-file decode counts for the one record. probe_light is added for a reader to run over the corpus; it was not run here, since builds and probes run on CI only
  • No new unit tests. Tests touched: the three in src/entities/light.rs are removed with the list they pinned.

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:

  • No Autodesk DWG SDK source (RealDWG, ObjectARX, ObjectDBX) or NDA-protected Autodesk documentation was consulted or imported.
  • No Open Design Alliance Teigha / Drawings SDK source was consulted or imported.
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported.

My contribution is based on the data bits of the pinned public corpus drawing (data file only), by the method recorded in CLEANROOM.md (2026-10-26 and the 2026-10-28 entry for classes with no DXF twin). Autodesk's public DXF Reference was recalled for the field names and the order of the first of the two BD groupings, disclosed in the CLEANROOM.md entry. No third-party DWG or DXF implementation was consulted, ACadSharp's and ezdxf's reading code, comments, tests and derived data included.

Developer Certificate of Origin

I affirm that the contribution is my own work and can be distributed under the project's Apache-2.0 license.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T10:28:25.285484Z 10e9361 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3f16aa5ce

ℹ️ 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".

Comment thread src/entities/dispatch.rs Resolved
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 28, 2026 10:34
@DrunkOnJava
DrunkOnJava merged commit e639ec6 into main Oct 28, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/light-class-entity branch October 28, 2026 10:42
DrunkOnJava added a commit that referenced this pull request Oct 28, 2026
…, and record them (#437)

README named LIGHT, ACSH_CYLINDER_CLASS, ACSH_REVOLVE_CLASS and RAPIDRTRENDERENVIRONMENT as skipped; they decode since #425, #426 and #427, and main's baseline now skips 32 records. CHANGELOG records those and the HATCH and TOLERANCE scorers (#389, #392).
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.

1 participant