Skip to content

fix(re): five wall scorers skip the probe's summary line, which Measure captures with its JSON rows - #1134

Merged
DrunkOnJava merged 2 commits into
mainfrom
fix/re-scorers-skip-probe-summary
Oct 30, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
fix/re-scorers-skip-probe-summary

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Measure writes a probe's stderr into the same file as its stdout (measure-reference-models.sh:352, > "$out" 2>&1), so the probe's summary line comes first. Five wall scorers parsed every line as JSON and crashed on it. They now read only the lines that start with {, as record_flags_vs_ifc and reference_slots_vs_ifc already do.

Motivation

Found while verifying #1132. In Measure 41027853083, wall_join_lists_vs_ifc on probe_re70_wall_join_lists failed with JSONDecodeError: Expecting value: line 1 column 1 on the summary line Revit 2024: 319 walls with a centreline, …. The move in #1132 did not cause it: the scorer has read the file this way since it was written.

Changes

wall_join_lists_vs_ifc, wall_angled_joins_vs_ifc, wall_arcs_vs_ifc, wall_layer_joins_vs_ifc and wall_tee_joins_vs_ifc: map(json.loads, open(path)) becomes a generator over the lines that start with {.

Testing

A probe's scorer comes from -f ref, not --ref. The first check (run 41028375789) set -f ref=main, so it ran main's unfixed scorers and failed on the same line 58. These runs used this branch for both:

  • Measure 41029780230, Core Interior, every scorer exit 0:
    • probe_re70_wall_join_lists → wall_join_lists_vs_ifc: "319 walls with a centreline; 122 name a wall".
    • probe_re71_layered_joins → wall_layer_joins_vs_ifc.
    • probe_re73_tee_joins → wall_tee_joins_vs_ifc: "202 single layer, every layer right".
    • probe_re75_wall_arcs → wall_arcs_vs_ifc: Core Interior has no arc walls.
  • Measure 41029788981: probe_re73_tee_joins → wall_angled_joins_vs_ifc, exit 0. Core Interior has no angled joins to count.

Breaking changes

None.

Related issues

Refs #1132.

…re captures with its JSON rows

measure-reference-models.sh runs a probe with stderr into the same file as stdout (> "$out" 2>&1), so a probe's summary line ('Revit 2024: 319 walls with a centreline, ...') comes first. wall_join_lists_vs_ifc, wall_angled_joins_vs_ifc, wall_arcs_vs_ifc, wall_layer_joins_vs_ifc and wall_tee_joins_vs_ifc parsed every line as JSON and stopped there with a JSONDecodeError (Measure 41027853083, wall_join_lists_vs_ifc on probe_re70_wall_join_lists). They now read only the lines that start with '{', as record_flags_vs_ifc and reference_slots_vs_ifc already do.

@DrunkOnJava DrunkOnJava left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Maintainer self-review. GitHub does not let a PR's author approve it, so this review stands in for an approval: I read the full diff and checked each claim.

  • Each scorer's one change replaces map(json.loads, open(path)) with a generator over the lines that start with {, the filter record_flags_vs_ifc and reference_slots_vs_ifc already use. Every JSON row a probe prints starts with {, so nothing a scorer counted before is dropped. Only the summary line and Measure's exit N trailer are skipped.
  • Verified: with this branch's scorers on main's probes (Measure 41029780230 and 41029788981), all five exit 0 on Core Interior. The earlier failure on run 41028375789 was main's scorer, because -f ref=main supplies it.

Ready to land.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 30, 2026 09:13
@DrunkOnJava
DrunkOnJava merged commit d9a9541 into main Oct 30, 2026
27 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/re-scorers-skip-probe-summary branch October 30, 2026 09:32
DrunkOnJava added a commit that referenced this pull request Oct 30, 2026
…elper, and one ArcWall scan per file (#1136)

## Summary

The audit's helper refactor (Griffin, 2026-10-30, "One copy of each
helper"): copied helpers become one shared copy each, little-endian
reads go through `le_bytes` where the conversion is exactly equivalent,
and the partition ArcWall scan runs once per file instead of up to four
times. Nothing an export writes should change; Measure checks that.

## Changes

- **`le_bytes`:** about 117 of 227 inline `from_le_bytes` reads now use
`le_bytes`, which gains `i32_at` and `u16_units`. The rest are left
because their failure semantics differ: `Result` errors with specific
messages, `InstanceField::Bytes` fallbacks in `walker.rs`, cursor
`take(n)?` reads, fixed-size arrays that cannot fail, and `src/bin`. A
raw-indexed read behind an explicit bounds check becomes `?` only where
that check makes the new `None` arm unreachable. Messages from `anyhow`
errors are kept word for word.
- **`find_subslice`:** one copy, memchr, with the empty-needle guard
kept. It replaces two wrappers and one scalar loop.
- **GUID:** one `guid_string`, now used by three readers. One IFC
GlobalId alphabet. `derive_default_ifc_guid` calls `compress_ifc_guid`.
- **`src/native_json.rs` (research):** `element_id`, `element_id_i64`,
`finite_triple` and `agree`, shared by twelve `native_*` and partition
modules. Variants with different semantics stay.
- **`src/vector_math.rs` (private):** `sub`, `dot`, `cross`, `distance`
and `polygon_area_xy`. Expressions are token-identical to the copies
they replace. `from_decoded::polygon_area_sqft` keeps its public path.
The three point-in-polygon copies and the signed areas differ and stay.
- **Storeys:** one `elevation_storey_name`.
- **ArcWall scan:** memoised on `RevitFile` per release and
`WalkerLimits` (`memoised_arc_wall_scan`). The production walk, the
partition assembler and both IFC-export sites share it. The public
`scan_partition_arc_walls_with_limits` keeps its signature.
- `changelog.d/changed/arc-wall-scan-memo.md`.

No public signature changes. `fuzz/` and `rvt-probes` call public items
only.

## Testing

- No local build, by policy. A side agent wrote the commits, and I read
every diff.
- The branch's new `use crate::le_bytes;` imports made four
`crate::le_bytes::` paths already on `main` redundant, which
`unused_qualifications` (an error under `-D warnings`) would have
rejected. They are fixed in `ac976268`.
- CI is the compiler, with clippy and rustdoc under `-D warnings`, MSRV
and i686.
- Measure
[41037020175](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41037020175),
unfiltered against `main` with nordic and r2025:
- The other 30 models are byte-identical on both sides: every
`ifc.sha256`, every `diagnostics.json` and all scorer outputs (1,262
files on the head side).
- The BIM4LCA office's host was unreachable during the base run, so the
office was **NOT MEASURED** on the `main` side.
- Its head-side export, diagnostics and every scorer output are instead
identical to those of #1074's head (run 41025987689, commit 60be7324).
Every PR merged since then (#1133, #1134, #1135, #1137) leaves the
export path untouched.
- `CI passed`, including clippy and rustdoc under `-D warnings`, MSRV
and i686.

## Found, not changed

`partition_scanner.rs:239/449` can index `buf[offset + 3]` past the end
when a tag matches in a buffer's last three bytes. That is a panic on
hostile input, so it will be fixed in its own PR rather than in a
behaviour-preserving refactor.

## Breaking changes

None.

## Related issues

None.
Repository owner deleted a comment from chatgpt-codex-connector Bot Oct 31, 2026
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