#1817·evals

[Bug] Context/Token Explosion in Geometric Script Generation (CadQuery/CalculiX)

Author: kumar1441Created Aug 26, 2026Updated Aug 26, 2026
Labelsbug

Describe the bug

When prompted to generate a parametric L-bracket via CadQuery, ChatGPT generates a raw union() without internal fillets. In downstream CalculiX (ccx) FEA mesh refinement, this sharp 90-degree corner causes a stress singularity (61.5 MPa @ coarse -> 83.8 MPa @ fine mesh), failing physical validity benchmarks.

To Reproduce

  1. Prompt ChatGPT to generate a 100mm wide L-bracket in CadQuery with named parameters.
  2. Run the generated script (chatgpt.py) to output the STEP geometry.
  3. Pass geometry to CalculiX FEA harness at fine mesh resolution (0.75mm) and observe stress divergence.

Code snippets

python
import cadquery as cq

width = 100.0
thickness = 10.0

leg1 = cq.Workplane("XY").box(width, thickness, thickness)
leg2 = cq.Workplane("YZ").box(thickness, width, thickness)
bracket = leg1.union(leg2) # Missing internal fillet creates singularity

cq.exporters.export(bracket, "l_bracket.step")

OS

windows

Python version

Python 3.8.0

Library version

Test executed via custom CadQuery/CalculiX (ccx) validation harness rather than native openai/evals runner