Testing Spatial Reasoning in New Models: A Parametric 3D Generation Benchmark

    This article presents a framework for evaluating the spatial reasoning of large language models through parametric 3D scene generation. It breaks the evaluation into three layers—runnability, structural plausibility, and parameter linkage—and explains why banning magic numbers is essential. A text-only bicycle-and-pelican task, a minimal-change acceptance test, and frame-by-frame animation checks are described, along with scoring suggestions and ideas for building a reusable evaluation pipeline.

    1. Background: Why “Can Write Code” Does Not Mean “Can Build a Model”

    When evaluating the overall capabilities of a new generation of large models, spatial reasoning is often the most underestimated dimension—and the one that exposes real capability most clearly. Many models can produce scripts that are syntactically correct and structurally complete, but problems surface as soon as the requirement becomes “the spatial relationships between parts must pass a parametric check”: geometry interpenetrating, drivetrain relationships and pose phases out of sync, and local dimensions failing to update when parameters change.

    The original evaluation approach asked models to generate a narrative 3D scene from a script, with several models completing the same task in parallel for comparison. To avoid the limited expressiveness of graphics libraries, the evaluation vehicle was switched from a common web-based 3D approach to the scripting interface of professional 3D software. This article strips away specific products and model names and abstracts the setup into a general framework for evaluating parametric 3D scene generation.

    1.1 Three Layers of Evaluation Goals

    • Layer 1: Runnability. Can the script be executed directly by an interpreter in headless mode and produce a scene?
    • Layer 2: Structural plausibility. Do the relative positions, orientations, and contact relationships between parts match physical intuition?
    • Layer 3: Parameter linkage. After changing the constants at the top, do all derived geometries recompute synchronously and correctly?

    The third layer is the dividing line. It separates “wrote a piece of code that runs” from “built a model that can evolve.”

    1.2 Key Constraints of the Task

    The task requires building a scene from a text description alone, with no reference image, and delivering a script that runs in headless mode. The scene: a pelican leaning forward in a riding posture on a seaside boardwalk at dusk, both wings extended forward to grip the handlebar, one webbed foot on a pedal and the other hanging in the air at the lowest point of the return stroke; a classic diamond frame with a canvas tool bag hanging from the down tube and a fishing net strapped to the rear rack; the crank drives the rear wheel, the chain is tensioned, and the riding posture must be consistent with the drivetrain phase.

    The value of these constraints is that they compress “aesthetic freedom” to a minimum and magnify “spatial correctness” into something verifiable.

    2. Parametric Design: Deriving Geometry from Constants

    The core mechanism of the evaluation is to lift all key dimensions and phases to the top of the script as global constants, and to forbid magic numbers disconnected from those constants inside functions.

    1. # Global constants: all geometry must be derived from these
    2. PELICAN_WINGSPAN = 1.15 # Wingspan (m); controls handlebar width and grip spacing
    3. BICYCLE_WHEELBASE = 1.02 # Wheelbase (m); drives frame geometry
    4. BICYCLE_CHAINRING_TEETH = 44 # Chainring teeth; drives chain length and gear ratio
    5. BICYCLE_COG_TEETH = 16 # Rear cog teeth
    6. BICYCLE_CRANK_PHASE = 35.0 # Crank phase angle (deg); drives pedal and foot contact
    7. # Derivation example: convert constants into geometric quantities
    8. import math
    9. def derive_layout():
    10. half_wb = BICYCLE_WHEELBASE / 2.0
    11. gear_ratio = BICYCLE_CHAINRING_TEETH / BICYCLE_COG_TEETH
    12. phase_rad = math.radians(BICYCLE_CRANK_PHASE)
    13. grip_span = PELICAN_WINGSPAN * 0.92 # Grip span slightly less than wingspan
    14. return half_wb, gear_ratio, phase_rad, grip_span

    2.1 Why Magic Numbers Are Banned

    Magic numbers are the enemy of parametric evaluation. A single hard-coded value inside a function produces “locally correct, globally misaligned” results after parameters change. Banning magic numbers essentially requires the model to build a clear dependency graph: wingspan affects the handlebar and grips, wheelbase affects the frame triangles, the tooth ratio affects the chain path and rear wheel speed, and the phase angle affects pedal position and foot contact.

    2.2 Expressing Linkage Correctly

    • Handlebar width should be derived from wingspan, and grip positions must enclose the wing tips.
    • When the chainring tooth count changes, the chain path must be recomputed so it neither interpenetrates nor hangs loose.
    • When the crank phase changes, pedal position and the pelican’s foot contact point must update together.
    • The gear ratio determines the speed relationship between rear wheel and crank, and the pose must match the current phase.

    3. Acceptance Method: Change Only Numbers, Not Code

    The evaluator runs a “minimal change” test: change wingspan from 1.15 to 1.35, chainring teeth from 44 to 52, and crank phase from 35 to 140, then rerun the script and check three results.

    3.1 Checklist

    • Does the handlebar widen with wingspan, and do the grips still enclose the wing tips?
    • After the chainring grows, is the chain path recomputed correctly, with no interpenetration and no slack?
    • After the phase change, does pedal-to-foot contact still hold, and is the riding pose self-consistent?

    3.2 Scoring Suggestion

    A three-tier score can be used: pass, partial pass, fail. Partial pass means the main structure is correct but local interpenetration or missing linkage exists; fail means the script does not run or the structure collapses after parameter changes. When comparing multiple models, keep the same prompt and the same constant-change plan fixed to ensure comparability.

    4. Video Generation from Pure Code and Creative Coding

    Beyond static scenes, the evaluation should also cover the ability to generate animation from pure code. The model is required to output a script that can be rendered frame by frame, keeping crank rotation, chain motion, rear wheel rotation, and pelican pose phase-consistent. This type of task tests spatial reasoning in the time dimension: not only one correct frame, but every frame correct.

    4.1 Dimensions for Assessing Creative Coding

    • Narrative completeness: whether scene elements are complete and the style is consistent.
    • Physical consistency: whether the drivetrain, contact, and center of gravity are plausible.
    • Evolvability: whether the scene still holds after parameter changes.
    • Maintainability: whether the structure is clear and dependencies are explicit.

    4.2 Practical Suggestions

    In real projects, this framework can be used in an automated evaluation pipeline: separate the constants block, the derivation functions, and the acceptance script; use container platforms and logging services to record each run; and use monitoring and alerting to flag regressions promptly. This supports both horizontal comparison across models and longitudinal tracking of one model’s capability evolution.

    5. Conclusion

    For evaluating spatial reasoning, the key is not how elaborate the scene is, but whether the constraints are verifiable. Driving geometry with global constants, verifying linkage with minimal changes, and testing dynamic behavior with frame-by-frame consistency gives a fairly objective picture of a model’s real level in parametric 3D generation and creative coding, and offers a reference for teams building a reusable model evaluation baseline.