Skip to content

Commit 2e767dc

Browse files
committed
Merge main into the conflicted-copies Area branch (#1434)
# Conflicts: # tools/ci/check-areas-across-saves.sh # tools/ci/measure-reference-models.sh
2 parents 9b5f0bc + dd3dc11 commit 2e767dc

61 files changed

Lines changed: 3487 additions & 188 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 118 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ jobs:
845845
RVT_PROJECT_CORPUS_DIR: ${{ github.workspace }}/_project_corpus/Revit
846846
run: |
847847
./target/ci/rvt-ifc "${RVT_PROJECT_CORPUS_DIR}/2024_Core_Interior.rvt" \
848-
-o /tmp/core-interior.ifc
848+
-o /tmp/core-interior.ifc --diagnostics /tmp/core-interior.diagnostics.json
849849
python -m ifcopenshell.validate /tmp/walker-real-project.ifc
850850
python -m ifcopenshell.validate /tmp/core-interior.ifc
851851
python tools/ci/ifc_schema_arity.py /tmp/walker-real-project.ifc /tmp/core-interior.ifc
@@ -886,6 +886,103 @@ jobs:
886886
python tools/re/space_profiles_vs_ifc.py /tmp/re1-architecture.ifc \
887887
"${RVT_PROJECT_CORPUS_DIR}/RE1-Architecture.ifc" \
888888
--match globalid --min-in-both 11 --min-area 11 --min-outline 11 --min-boundary 11
889+
# #1437: every IfcSpace says what it is (tools/re/space_kinds_vs_ifc.py).
890+
# The two real exports pass: Core Interior's 116 rooms and RE1
891+
# Architecture's 11. Then the check is shown to fail, on copies of Core
892+
# Interior's export with one thing broken each: the property renamed, so
893+
# no space has a kind; every room called an area, which holds no Area
894+
# outline source; and every room's outline source made an Area's. Each
895+
# must fail with the count of the 116 spaces it broke.
896+
- name: Every IfcSpace says what it is, and the check fails when one does not
897+
run: |
898+
set -euo pipefail
899+
run_check() {
900+
status=0
901+
python tools/re/space_kinds_vs_ifc.py "$1" > "$2" || status=$?
902+
cat "$2"
903+
return "$status"
904+
}
905+
run_check /tmp/core-interior.ifc /tmp/kinds-core.txt
906+
grep -qx 'space kinds: IfcSpace 116' /tmp/kinds-core.txt
907+
grep -qx 'space kinds: room 116' /tmp/kinds-core.txt
908+
grep -qx 'space kinds: PASS' /tmp/kinds-core.txt
909+
run_check /tmp/re1-architecture.ifc /tmp/kinds-re1.txt
910+
grep -qx 'space kinds: IfcSpace 11' /tmp/kinds-re1.txt
911+
grep -qx 'space kinds: PASS' /tmp/kinds-re1.txt
912+
sed "s/IFCPROPERTYSINGLEVALUE('SpaceKind'/IFCPROPERTYSINGLEVALUE('SpaceKindMoved'/" \
913+
/tmp/core-interior.ifc > /tmp/kinds-none.ifc
914+
sed "s/IFCPROPERTYSINGLEVALUE('SpaceKind',\$,IFCTEXT('room')/IFCPROPERTYSINGLEVALUE('SpaceKind',\$,IFCTEXT('area')/" \
915+
/tmp/core-interior.ifc > /tmp/kinds-area.ifc
916+
sed "s/IFCPROPERTYSINGLEVALUE('SpaceOutlineSource',\$,IFCTEXT('stored_solid')/IFCPROPERTYSINGLEVALUE('SpaceOutlineSource',\$,IFCTEXT('area_boundary')/" \
917+
/tmp/core-interior.ifc > /tmp/kinds-source.ifc
918+
for broken in none:'no SpaceKind 116' area:'area without an Area outline source 116' source:'other kind with an Area outline source 116'; do
919+
name=${broken%%:*}
920+
expected="space kinds: ${broken#*:}"
921+
cmp -s /tmp/core-interior.ifc "/tmp/kinds-$name.ifc" \
922+
&& { echo "::error::the $name copy of the export was not changed"; exit 1; }
923+
if run_check "/tmp/kinds-$name.ifc" "/tmp/kinds-$name.txt"; then
924+
echo "::error::the check passed an export with $name broken"
925+
exit 1
926+
fi
927+
grep -qx "$expected" "/tmp/kinds-$name.txt" \
928+
|| { echo "::error::the $name copy did not fail as '$expected'"; exit 1; }
929+
grep -qx 'space kinds: FAIL' "/tmp/kinds-$name.txt"
930+
done
931+
# #1437: the same on an export with no geometry, which keeps SpaceKind and
932+
# has no SpaceOutlineSource by design (116 rooms, none checked for
933+
# agreement), and the run total (`--total`) shown to fail where it must: on
934+
# a result that says PASS over a failure count, on an export with geometry
935+
# whose spaces have lost their SpaceOutlineSource (the result passes alone,
936+
# with the agreement not checked), and on a result that saw none of the 116
937+
# spaces its export counted; and to pass on a run of models with no space,
938+
# and on the typed export beside the geometry one.
939+
- name: SpaceKind in an export with no geometry, and the run total fails where it must
940+
env:
941+
RVT_PROJECT_CORPUS_DIR: ${{ github.workspace }}/_project_corpus/Revit
942+
run: |
943+
set -euo pipefail
944+
./target/ci/rvt-ifc "${RVT_PROJECT_CORPUS_DIR}/2024_Core_Interior.rvt" --mode typed-no-geometry \
945+
-o /tmp/core-typed.ifc --diagnostics /tmp/core-typed.diagnostics.json
946+
python tools/re/space_kinds_vs_ifc.py /tmp/core-typed.ifc > /tmp/kinds-typed.txt
947+
cat /tmp/kinds-typed.txt
948+
for expected in 'IfcSpace 116' 'room 116' 'spaces whose outline source agreement was not checked 116' PASS; do
949+
grep -qx "space kinds: $expected" /tmp/kinds-typed.txt \
950+
|| { echo "::error::the typed-no-geometry export did not read '$expected'"; exit 1; }
951+
done
952+
sed "s/IFCPROPERTYSINGLEVALUE('SpaceOutlineSource'/IFCPROPERTYSINGLEVALUE('SpaceOutlineMoved'/" \
953+
/tmp/core-interior.ifc > /tmp/kinds-markers.ifc
954+
python tools/re/space_kinds_vs_ifc.py /tmp/kinds-markers.ifc > /tmp/kinds-markers.txt
955+
grep -qx 'space kinds: spaces whose outline source agreement was not checked 116' /tmp/kinds-markers.txt
956+
python tools/re/space_kinds_vs_ifc.py /tmp/walker-real-project.ifc > /tmp/kinds-einhoven.txt
957+
sed 's/^space kinds: FAIL$/space kinds: PASS/' /tmp/kinds-none.txt > /tmp/kinds-lie.txt
958+
total() { # case, the exit it must have, the line it must print, then name=result,diagnostics ...
959+
local case=$1 want=$2 text=$3 dir pair name rest status=0
960+
shift 3
961+
dir="/tmp/total-$case"
962+
rm -rf "$dir"
963+
for pair in "$@"; do
964+
name=${pair%%=*}
965+
rest=${pair#*=}
966+
mkdir -p "$dir/$name"
967+
: > "$dir/$name/ifc.sha256"
968+
cp "${rest%%,*}" "$dir/$name/space_kinds_vs_ifc.txt"
969+
cp "${rest#*,}" "$dir/$name/diagnostics.json"
970+
done
971+
python tools/re/space_kinds_vs_ifc.py --total "$dir" > "$dir.txt" || status=$?
972+
cat "$dir.txt"
973+
[ "$status" = "$want" ] || { echo "::error::--total ($case) exited $status, not $want"; exit 1; }
974+
grep -qxF "space kinds across the run: $text" "$dir.txt" \
975+
|| { echo "::error::--total ($case) did not print '$text'"; exit 1; }
976+
}
977+
total geometry-and-typed 0 PASS \
978+
core=/tmp/kinds-core.txt,/tmp/core-interior.diagnostics.json \
979+
typed=/tmp/kinds-typed.txt,/tmp/core-typed.diagnostics.json
980+
total no-spaces 0 PASS einhoven=/tmp/kinds-einhoven.txt,/tmp/walker-real-project.diagnostics.json
981+
total markers-dropped 1 'FAIL, spaces of an export that has geometry have no SpaceOutlineSource to check' \
982+
core=/tmp/kinds-markers.txt,/tmp/core-interior.diagnostics.json
983+
total verdict-says-pass 1 'FAIL, a model failed' core=/tmp/kinds-lie.txt,/tmp/core-interior.diagnostics.json
984+
total saw-nothing 1 "FAIL, a model's spaces are not the number the export itself counted" \
985+
core=/tmp/kinds-einhoven.txt,/tmp/core-interior.diagnostics.json
889986
# #908: doors and windows are drawn from their saved graphics by
890987
# default (2026-10-29); every other class only with --saved-meshes, so
891988
# no other job reads theirs. Export both real projects with it, fail
@@ -1370,6 +1467,23 @@ jobs:
13701467
done
13711468
echo "::error::${name} did not hash to ${sum} from either host"
13721469
exit 1
1470+
# #1359: the room fallback through the Python API
1471+
# (tests/python/test_room_phase_fallback.py), on Autodesk's
1472+
# rac_basic_sample_project of Revit 2018: its 14 rooms are in the second of
1473+
# three phases and the last holds none, the one project known to take the
1474+
# fallback. Fetched from Autodesk's download host and pinned by sha256, as
1475+
# research/autodesk-sample-projects.tsv pins it; never stored or cached.
1476+
- name: Fetch Autodesk's rac_basic_sample_project (Revit 2018)
1477+
if: runner.os == 'Linux'
1478+
shell: bash
1479+
run: |
1480+
set -euo pipefail
1481+
url=https://revit.downloads.autodesk.com/download/2018RVT_RTM/Docs/InProd/rac_basic_sample_project.rvt
1482+
sum=8fce035abd3e5a78c68a8d6529fd5066d04c38ebf7ec3dd1de79495d85481535
1483+
out="${GITHUB_WORKSPACE}/_project_corpus/Autodesk/2018-rac_basic_sample_project.rvt"
1484+
mkdir -p "$(dirname "${out}")"
1485+
curl -sSfL --retry 5 --retry-all-errors --max-time 900 -o "${out}" "${url}"
1486+
echo "${sum} ${out}" | sha256sum -c -
13731487
- name: Python API integration tests on Revit files
13741488
shell: bash
13751489
run: |
@@ -1381,6 +1495,9 @@ jobs:
13811495
if [ -f _project_corpus/Revit/RE1-Architecture.rvt ]; then
13821496
export RVT_PROJECT_CORPUS_DIR="$PWD/_project_corpus/Revit"
13831497
fi
1498+
if [ -f _project_corpus/Autodesk/2018-rac_basic_sample_project.rvt ]; then
1499+
export RVT_SAMPLE_PROJECTS_DIR="$PWD/_project_corpus/Autodesk"
1500+
fi
13841501
python3 -m pytest tests/python -q -rs
13851502
# S2 (#873): the type stubs are the Python API's listing, and
13861503
# tools/ci/python-api-compat.py judges a breaking change by diffing

‎.github/workflows/measure.yml‎

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ jobs:
778778
PSETS_MISSING: ${{ inputs.psets_missing }}
779779
KEEP_IFC: ${{ inputs.keep_ifc && '1' || '' }}
780780
MCP_REQUIRE_FOLDED_FIELD: ${{ matrix.side != 'base' && '1' || '' }}
781+
MCP_REQUIRE_SPACE_KIND: ${{ matrix.side != 'base' && '1' || '' }}
781782
# A run of the samples checks the Areas of rac_advanced across its
782783
# 2024 to 2027 saves on the head side (main writes none on 2025 to
783784
# 2027) whenever all four samples are in it, and its 2021 save against
@@ -860,8 +861,8 @@ jobs:
860861
# Compare, which does not need it, still reports (a failed step in a measure
861862
# shard would skip Compare). The base side is not gated: its files show what
862863
# each check says of `main`. A check skipped on purpose (no `samples`, no 2026
863-
# or 2027 sample, the `scorers` excluding it, a run without the earlier saves)
864-
# says so in a notice and in the run summary. Measure is not a required check:
864+
# or 2027 sample, the `scorers` excluding it, a run without the earlier saves,
865+
# a run with `ifc_flags`) says so in a notice and in the run summary. Measure is not a required check:
865866
# the failure is read before landing, by the landing rule.
866867
same-project-gates:
867868
name: Same-project gates
@@ -901,15 +902,16 @@ jobs:
901902
needs: [plan, measure]
902903
runs-on: ubuntu-24.04
903904
steps:
904-
# The semantic diff's script, from the workflow's own ref (this job holds
905-
# no secret and runs no measured code). First, since a checkout cleans the
906-
# workspace.
905+
# The semantic diff's script and the IfcSpace kinds' total (#1437), from the
906+
# workflow's own ref (this job holds no secret and runs no measured code).
907+
# First, since a checkout cleans the workspace.
907908
- name: Workflow tools
908-
if: needs.plan.outputs.base == 'true'
909909
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
910910
with:
911911
persist-credentials: false
912-
sparse-checkout: tools/re/semantic_diff.py
912+
sparse-checkout: |
913+
tools/re/semantic_diff.py
914+
tools/re/space_kinds_vs_ifc.py
913915
sparse-checkout-cone-mode: false
914916
# Each side's shards hold disjoint models; merged, they are the
915917
# measure-head and measure-base directories one runner used to write.
@@ -1088,6 +1090,34 @@ jobs:
10881090
with:
10891091
name: compare-scorer-diff
10901092
path: scorer-diff.txt
1093+
# #1437: every IfcSpace of every export the head side wrote says what it
1094+
# is (tools/re/space_kinds_vs_ifc.py). The total fails the job when a
1095+
# model has no result or failed (judged on its counts, not its verdict
1096+
# word), when a space has no kind or disagrees with its outline source,
1097+
# when a model's spaces are not the number its own export counted, and
1098+
# when a geometry export's spaces have no outline source to check, so a
1099+
# check that looked at nothing cannot pass. A run of models that hold no
1100+
# space, such as one filtered to two Revit 2025 roofs, passes when every
1101+
# export agrees it holds none. Last, so the summary, the semantic diff and
1102+
# the uploads are written first. A run that names `scorers` without this
1103+
# one has not asked for the check and is left alone; naming it runs the
1104+
# step that judges it. The base side is not gated: it is main, whose
1105+
# exports have no kind to find.
1106+
- name: Every IfcSpace says what it is
1107+
if: ${{ !cancelled() && (inputs.scorers == '' || contains(inputs.scorers, 'space_kinds_vs_ifc')) }}
1108+
shell: bash
1109+
run: |
1110+
status=0
1111+
python3 tools/re/space_kinds_vs_ifc.py --total measure-head > space-kinds-total.txt 2>&1 || status=$?
1112+
cat space-kinds-total.txt
1113+
{
1114+
echo "### IfcSpace kinds across the run (head)"
1115+
echo
1116+
echo '```'
1117+
cat space-kinds-total.txt
1118+
echo '```'
1119+
} >> "$GITHUB_STEP_SUMMARY"
1120+
exit "$status"
10911121
10921122
# B81: the base and head jobs above run on different runners, so their wall
10931123
# times compare machines as much as code. With `timing`, rvt-ifc is built at

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The full list, with each gap's status and evidence, is in [`docs/evidence.md`](d
9999
- On Revit 2008 to 2023 projects an element's body is its bounding box, cut back at its joins where they are read. On 2026 and 2027 it is that too, except for beams along their axes, stair runs and tread landings (a monolithic landing stays its box), and floors, ceilings and slabs drawn from their sketch lines, with shaft voids cut from floors and ceilings (RE-341; held to the same project's 2024 and 2025 saves, which cannot catch an error those saves share, and not scored against a Revit export except for one stair flight; quantities and property sets of those bodies are not compared). A roof there keeps the record-box solve as on `main`, without its slope: a sloped roof can still be drawn as its outline at the record box's full height, a level block, or as its box, and no 2026 or 2027 scorer checks it. On 2024 and 2025 it is the box only where the bytes are not decoded: roofs by extrusion outside Revit 2025, hip roofs over a T or U footprint, monolithic spiral stair flights and straight riserless ones with a nosing, edited wall profiles, ducts and pipe fittings. From 2023, doors and windows are drawn from Revit's saved meshes where those decode whole, and from 2024 so are the walls that embed a curtain wall where Revit raised their base (RE-340); furniture and other loadable families stay boxes unless `--saved-meshes` is given, and `--family-extrusions` (opt-in; implies `--saved-meshes`) draws an instance whose family's extrusions reproduce its mesh from them, as extruded profiles; an arc is written as the arc, whatever its radius.
100100
- `rvt-elements` and Python list each element's saved parameters on Revit 2023 to 2027 files, experimentally on 2015 to 2022 ones and not on 2008 to 2014, but built-in parameters have no name, a wall's or floor's type parameters are not joined to it, and only `rvt-ifc --revit-property-sets` writes the rest into IFC.
101101
- Family files give metadata, previews and types but no family geometry, and template files (`.rte`, `.rft`) are not measured, because no template is in any corpus.
102-
- A room is left out of the export when its own phase is not the export phase, the project's last unless `rvt-ifc --phase` names another, as Revit's exporter does (RE-326); a room whose phase is unset or unread is written, and so is an Area or an MEP space. This is measured on no Revit export made with the default setup, because none has such a room: the one Revit export of a project with rooms outside its last phase (Autodesk's `rac_basic_sample_project`, 14 rooms) holds them, and rvt-rs writes them with `--phase "Working Drawings"`. The Python bindings and the viewer export the last phase.
102+
- A room is left out of the export when its own phase is not the export phase, the project's last unless `rvt-ifc --phase` names another, as Revit's exporter does (RE-326); a room whose phase is unset or unread is written, and so is an Area or an MEP space. Where no phase is named and the last phase holds no room, the rooms written are those of the latest phase that holds any, and the diagnostics, `rvt-ifc` and the Python bindings say so (#1359): Autodesk's `rac_basic_sample_project` has 14 rooms in Working Drawings and none in its last phase, and writes them by default; naming the last phase writes none. The phase rule is measured on no Revit export made with the default setup, because none has such a room: the one Revit export of a project with rooms outside its last phase holds the 14, and rvt-rs writes them with `--phase "Working Drawings"`. The fallback is a choice, not a measurement of Revit's default. The Python bindings and the viewer export the default phase.
103103
- Semantic editing of a Revit file is not implemented: the write path patches named streams byte for byte, and field-level writes wait on ADR-002.
104104

105105
## Command-line tools

0 commit comments

Comments
 (0)