Self-Debugging Geometry Checks for Aligning Fragmented 3D Scene Graphs

When a robot, a building-management system, or a mapping service describes the same room more than once, the descriptions rarely agree. One may come from a noisy scan, another from a CAD model, and a third from a sentence such as "the lamp is between the sofa and the window." Matching "this chair" in one description to "that chair" in another is a form of entity alignment, the knowledge-graph problem of linking nodes across separately built graphs that refer to the same real thing. On clean encyclopedic benchmarks this problem is close to solved. In physical scenes it is far from solved. The best feed-forward aligner for 3D scene graphs, SGAligner++, reaches only 55.42% Hits@1 on noisy real reconstructions. It makes that decision in a single cosine-similarity pass and has no way to check it.

We propose to give the aligner a way to check its own guesses. A language model writes a small program that tests a candidate matching against geometry, for example "if these three pairs are correct, the fitted rigid transform should place the lamp between the sofa and the window." The program runs, and the resulting trace reports which constraints failed, by how much, and under which reference frame. The model then revises either the program or the matching. The bet is that two kinds of reasoning cooperate here. Executable checks catch geometric contradictions that embeddings blur together. Code written by a language model can express open-vocabulary spatial relations, and choices about reference frame, that a fixed hand-written checker does not cover.

Core Claim

Our claim is that closed-loop, execution-checked verification recovers a meaningful share of the correspondences that feed-forward scene-graph aligners get wrong under noise and cross-modal heterogeneity. A "closed loop" here means the system generates a verification program, runs it, reads the failures, and rewrites. We expect the benefit of having a language model author the checks, rather than a fixed geometric verifier, to concentrate on fragments whose relations are stated in language and in an unknown viewpoint frame. That is the egocentric-versus-allocentric confusion documented by ViewSpatial-Bench, where the model mixes up "left of the camera" with "left of the person." We state the second half of the claim narrowly on purpose. If a hand-written verifier with frame enumeration matches the loop everywhere, the language model is unnecessary, and the experiments are designed to reveal that outcome.

Where This Sits

Three threads motivate the idea. The first shows that scene alignment can be posed as entity alignment. SGAligner embeds object geometry, neighborhood structure, and attributes into a joint space, matches nodes by similarity (0.923 Hits@1 on clean 3RScan), and then runs RANSAC on the matched objects to recover pose. SGAligner++ adds CAD meshes, captions, and spatial referrals through attention fusion, but it uses GPT-4o-mini only offline to turn referrals into training triples. Neither system revisits a match once it is made. We keep their embeddings as the candidate generator and add the revisiting step they lack.

The second thread supplies the method. Execution-feedback loops repair code using compiler and runtime signals, from DeepFix to traceback-driven self-correction in CAAFE. MEIC shows that tracking edit history and rolling back to the last stable version keeps such loops from compounding regressions. Taneja et al. put a formal checker inside the loop. On the alignment side, PRASEMap alternates a probabilistic logical reasoner and a graph embedding: confident logical matches become training seeds, and the embedding proposes new candidates. That alternation raised F1 on MED-BBK-9K from 50.8% to 71.3%. Its reasoner understands only discrete predicates, however, not distances, containment, or headings. Our design is PRASEMap's alternation with the logical reasoner replaced by executed geometry programs, plus MEIC-style rollback.

The third thread constrains the design. pySpatial has a language model write 3D camera code and beats GPT-4.1-mini on MINDCUBE by nearly 13 points. It runs open-loop, though, and attributes 13% of its errors to reconstruction quality. Our loop treats reconstruction noise as something a trace can expose, for instance as a single constraint that is badly violated while the others hold. Spatial Mental Modeling from Limited Views reports that handing a frozen model an oracle map hurts its answers, and that the maps models generate rarely match true geometry. We take this as a reason never to ask the model to read geometry and judge it. We ask it only to write tests that the interpreter judges. Finally, iterative refinement is known to plateau after a few rounds (Yan et al.) and can reinforce bad patterns (Srivastava et al.). We therefore cap the number of iterations and accept a revision only if a global consistency score improves.

Research Program

The system has three parts.

The first is a candidate generator: SGAligner++ trained on the standard 3RScan partition, which returns the top-k matches and a confidence for every node. Only nodes below a confidence threshold enter the loop. This keeps the cost far from the quadratic number of pairwise checks that the LM-driven alignment survey identifies as prohibitive.

The second is a small, typed geometry interface. It covers object centroids and bounding boxes, rigid-transform fitting from hypothesized pairs, containment, distance, ordering along an axis, and relation predicates that take an explicit reference frame argument (camera, a named object's facing direction, or world).

The third is the loop itself. For a cluster of uncertain nodes and their neighbors, the language model writes a program. The program asserts the relations each fragment states, fits a transform from the hypothesized matches, and returns per-constraint residuals. The interpreter runs it and returns a structured trace listing which assertions failed, their magnitudes, which objects they involve, and any runtime errors. The model then edits. It can swap a correspondence, change the frame assumed for a text relation, mark one object as moved between scans (3RScan scenes change over time), or flag a constraint as likely reconstruction noise. A global score, the number of satisfied cross-fragment constraints minus a penalty on residuals, decides whether the edit is accepted. Rejected edits are rolled back. Accepted matches are added as seeds, and the embedding model re-scores the remaining candidates in a PRASEMap-style outer loop.

We will analyze where the gains come from in several ways. We will stratify results by fragment modality pair (scan to scan, scan to CAD, scan to text referral). We will also stratify by whether the relations involved fall inside or outside the vocabulary of a fixed verifier. For every error the system fixes or introduces, we will record which trace signal triggered the edit.

Baselines

The naive reference point is SGAligner++ alone, with matching by highest similarity. Its strongest reported figure on the hard setting is 55.42% Hits@1 on noisy real reconstructions, against 18.57% for SGAligner, both reported in SGAligner++. We will retrain or reuse it on identical splits and report our own reproduced number next to the cited one. Every other system inherits its candidate lists, so any gain comes from verification rather than from better retrieval.

The strongest competitor is a hand-written geometric verifier inside the same PRASEMap-style seed loop. It runs RANSAC over centroid correspondences among the top-k candidates, and it has a fixed library of relation predicates that it evaluates under every candidate reference frame by enumeration. This is the best non-language-model version of our idea, and it is the main threat. It receives the same candidates, the same confidence threshold, the same geometry interface, and an equal wall-clock budget.

A third baseline is passive language-model judgment. The same model is given verbalized descriptions of each candidate pair, with coordinates in text, and is asked whether the two are the same entity, using Chain-of-Thought prompting. The survey describes this pattern as the dominant role of language models in entity alignment.

Two ablations isolate the key ingredient. The first is a one-shot version: the program is written once and executed with no revision, which is the pySpatial regime. The second is a no-execution self-refinement version: the model critiques and rewrites its program without ever running it.

Beating the strongest baseline means a Hits@1 gain over the fixed verifier on the cross-modal text-referral subset that exceeds seed-to-seed variance, with no loss on the scan-to-scan subset, at a reported per-alignment cost. Beating SGAligner++ by itself is not enough.

Why not just…?

Why not just add RANSAC-style geometric verification to SGAligner++ and skip the language model? This is a real threat, and it is the comparison we treat as decisive. On scan-to-scan pairs, where both sides have coordinates and relations are rigid, we expect the fixed verifier to capture most of the available gain, and possibly all of it. The language model earns its cost only where the checks must be built from open-vocabulary text relations whose viewpoint is unstated. The stratified comparison will show whether that subset exists and how large it is. If the fixed verifier with frame enumeration matches the loop on that subset too, we will report that the contribution is the verification loop, not language-model authorship.

Why not just fine-tune the embedding aligner harder, or train a spatially specialized model? Specialized fine-tuning does work for local direction questions. MVSM reaches 82.09% on ViewSpatial-Bench where GPT-4o scores 34.98%, according to ViewSpatial-Bench. However, a better embedding still makes an irreversible decision per node. It cannot detect that three of its matches jointly imply an impossible transform. We test this by applying our loop on top of the strongest embedding we can train. If the loop's gain shrinks to zero as the embedding improves, the reviewer is right.

Why not just ask a language model, with Chain-of-Thought, whether two entities match? Verbal spatial simulation is weak. Base models score 37.8% on MINDCUBE in Spatial Mental Modeling from Limited Views, and the same paper finds that giving models geometry passively hurts them. The passive-judgment baseline tests this directly on our data, at equal call budget.

Why not just iterate without running anything? Self-critique without an external check has no source of new information about the scene, and refinement gains are known to plateau. The no-execution ablation measures how much of the gain comes from the interpreter rather than from extra model tokens.

Proposed Experiments

The primary benchmark is 3RScan, using the partition SGAligner reports: over 15,000 training pairs and 1,900 test pairs, with overlaps from 10% to 90%. We cover the clean setting (0.923 Hits@1 for SGAligner) and the noisy real-reconstruction setting from SGAligner++. Cross-modal fragments come from SGAligner++'s CAD and spatial-referral modalities, built on ScanNet and SceneVerse. We additionally hold out referral sentences whose relations are absent from the fixed verifier's predicate library. That held-out subset is where the language-model-authorship claim lives.

Metrics are Hits@1 and Hits@5 over all nodes and over the low-confidence subset, and relative translation error of the final pose recovered from matched objects. We also report a constraint-consistency rate: the share of stated cross-fragment relations satisfied by the final matching under ground-truth geometry. This is our analogue of the isomorphic rate in the mental-modeling work. Finally we report wall-clock cost per alignment against SGAligner++'s roughly 18 ms and pySpatial's roughly 7.45 s per query.

Three checks would settle the question. First, does the loop beat the fixed verifier on the out-of-vocabulary text-referral subset while tying it on scan-to-scan pairs? This pattern would confirm the narrow claim, and a tie everywhere would refute it. Second, does removing execution, or removing revision, erase most of the gain? This tells us whether the interpreter and the loop, rather than the model, do the work. Third, does accuracy rise, plateau, or fall with the iteration cap, with and without rollback? This tests whether the rollback rule prevents the drift that open-ended refinement is known to produce. As a secondary transfer check, we will add the same execute-and-revise loop to pySpatial-style camera programs on MINDCUBE. The aim is to see whether trace-driven revision also reduces its reconstruction-attributed failures, compared against its reported 58.56% accuracy.