Calcy on graph paper 2D → .ic Pipeline
InstaCalc (the game) · Asset Pipeline Spec · November 2026

From concept art to procedural .ic & WebGL2 rigs

Instead of shipping 75 MB textured .glb downloads for every boss, we combine Strategy-5 WebGL2 CSG, ComfyUI 3D volume priors, and exploded turnaround schematics into compact .ic / .ic.md assets rendered live on top of our modular ic-3d.js + ic-sdf-shot.js engine.

90.6% Euler 3/4 silhouette IoU 82 / 100 Euler blind parity (78/100 Brass) 924–1,014 B csg_dct (82.9–91.2% 3D IoU) 2.6–3.9 KB dct2 spectral payloads 58.0 / 100 Ortho 3-view check (flags pose/back drift) 9–17 rigged ASCII + CSG bones
STEP 1 · CLEAN STILL

Reference + Mask

Take the trailer frame (435×576) and cut the character out cleanly with BiRefNet (L1=0.0211).

STEP 2A · VOLUME

ComfyUI → 3D-DCT

TRELLIS.2 builds 3D silhouette proportions, compressed into 2.6–3.9 KB dct2 or < 1 KB csg_dct.

STEP 2B · JOINTS

Prompts A–E Kits

AI turnaround & exploded component sheets carve isolated limbs + bone pivots automatically.

STEP 3 · STRATEGY 5

Hybrid .ic + Rig

Fuse the smooth R16F torso with crisp CSG plinths/decals (eˣ) & Voronoi lava shaders.

1. Result First · V10 & V12 Visual Proof Measured on local WebGL2 + wipe_score.py

Does a < 1–3 KB math file actually match concept art?

Judge it side-by-side — cards 3, 4, and Hero #2 below are compiled and rendered live right on your GPU from our actual .ic files (no pre-baked PNGs). Heavy organic curves come from a quantized R16F 3D-DCT table; razor-sharp pieces (the numbered plinth, shoulder pipes, hollow collar, and eˣ plate) stay pure CSG geometry.

Trailer Concept Still
1. Trailer Concept Still Uncropped 435×576 target frame with numbered plinth.
BiRefNet Surgical Mask
2. BiRefNet Cutout Mask Registered to concept (L1=0.0211); strips floor text.
3. V10 Live .ic (950 B!) Decoded live from euler-titan-1kb.ic (csg_dct) — zero PNG.
Trailer Concept Still
CONCEPTLIVE .IC
4. Live 50/50 Concept ↔ .ic Drag anywhere on image to scrub concept vs live WebGL2 shader.
4x5 Parity Grid
4×5 Parity Grid: 90.6% Global IoU Cells: C4=100%, D4=99%, D5=94%, B2=94%, D3=93%.
5-Strategy Quantitative Bakeoff
5-Strategy Bake-Off S1 (55–61%) → S2 Backsolve (70%) → S3 CSG (74%) → S5 .ic (94.4%).
Brass Mech Concept
CONCEPTLIVE S5
Hero #2: Brass Inf Mech Strategy 5 (70.6% IoU) Live WebGL2 crisp RBox + 2×2 rocket pods (924 B csg_dct · drag to scrub).
Measured Signal (tools/wipe_score.py)Before Shader TuningAfter Closed-Loop TuningConcept Target (00_ref_euler.jpg)
Texture & Lighting Parity 42.5 / 100 71.8 / 100 (+29.3 pts) Wrap studio key + sky fill + palm radial halo
Basalt Rock Albedo & Texture Std lum=0.126 (too dark/cold) lum=0.212 (std=0.077) lum=0.206 (std=0.072, charcoal slate)
Magma Seam & Volumetric Palm Halo 16.2% thin flat stripes 40.5% warm bevel + view halo 33.6% glowing fissures + soft palm plasma
Foreground Pixel L1 Error 0.1663 0.1320 (-20.6% error) Lower is closer inside Titan silhouette
Plinth Stone L1 & Brightness L1=0.0821 (speckled bevel) L1=0.0594 (lum=0.355) lum=0.340 smooth warm clay drum
Two-Band dct2 Spectral Codec · 80–88% Size Cut

Boss Compression: 25.7 KB → 3.2 KB (90.0% IoU Held)

Keeping low frequencies exact in int16 (lo=5–6) while pruning 70–80% of high-frequency 3D-DCT modes and sqrt-companding into int8 shrinks every boss by 80–88% and speeds up JS IDCT decode by ~4.6×. Pairing CSG base primitives with sparse residuals cuts further toward < 1.5 KB (~94%).

Hero AssetDense dct1dct2 (3 KB)csg_dct (<1 KB)
euler-titan25,713 B3,229 B (90.0%)950 B (-96.3% · 83.3%)
brass-inf-mech23,697 B3,102 B924 B (-96.1% · 82.9%)
calcy-hero15,530 B2,663 B1,014 B (-93.5% · 91.2%)
mandelbrot-lord19,368 B3,949 B-79.6% dct2
Verified AAA Gate · tools/ortho_score.py

Ortho 3-View Lock Catches Hidden 3D Bugs

A single 3/4 wipe can hit 90.6% while hiding back-side hallucinations. Scoring Front | Side | Back orthos (ortho=1) caught mirrored back-decal projection (fixed in GLSL via world n.z) and proved single-view extraction scores only 58.0 / 100 against a canonical A-pose ortho sheet (Front 53.5% · Side 57.8% · Back 54.4%). True AAA needs Ortho First → Rigged Pose → PBR Gate → < 4 KB Budget.

Canonical 3-View Ortho Turnaround
Concept Ortho SheetFront · Side · Back on height rulers
Live Ortho 3-View Alignment Diagnostic
Ortho Diff (58.0 / 100)Exposes pose & pipe drift across views

Try the interactive wipes yourself: drag the live split slider between concept art and real-time WebGL2 shaders, or inspect every rigged strategy side by side.

Open Concept↔Live Wipe ↗ Open 3D Skeleton Schematic ↗ Compare 950 B (-96%) ↗ Brass Mech Primitive Wipe ↗ Open 5-Strategy & Rig Lab ↗
Developer + Agent Automation CLI · .ic Workflow Drivers & Solvers (tools/ic/)
# 1. Unified .ic Engine: Native Constraint/ML Solvers (fsolve/solvefor/gradfor/odesolvefor) + host.ml.* + Pure-JS SOTA
node tools/ic-run.mjs tools/ic/rig-constraints.ic --json
node tools/ic-run.mjs tools/ic/ml-pipeline-e2e.ic --json
node tools/ic-run.mjs tools/ic/asset-solver.ic --json

# 2. Run .ic Workflow Drivers via host.sh (compile + autodiff grads + doctest gate + /100 & /1000 scoring + OBJ export)
node tools/ic-run.mjs tools/ic/asset-pipeline-driver.ic
node tools/ic-run.mjs tools/ic/video-pipeline-driver.ic

# 3. Any video (.mp4/.mov) or image -> zero-shot SAM2.1 + DepthV2 .ic / compressed dct2 / csg_dct
node scripts/agent/arbitrary_video_to_ic.mjs --video input.mp4 --name boss-slug --render
python3 tools/video2ic.py input.mp4 --name boss-slug --comfy --sub1kb
python3 tools/assets/dsl_invert.py arcade/public/game/assets/ic/brass-inf-mech.ic arcade/public/game/assets/ic/brass-inf-mech-1kb.ic

# 4. Objective Wipe Parity + 3-View Ortho Gate (measured by PIL/cv2 -> scored in tools/ic/asset-pipeline-core.ic)
python3 tools/wipe_score.py ref.png live_clean.png live_mask.png ref_mask.png --json
python3 tools/ortho_score.py tools/ortho_3view_suite.json
python3 tools/suite_audit.py --live http://127.0.0.1:8199
2. Turning Stills Into Articulated Rigs

Exploded Schematics (Prompts A–E) build bendable skeletons automatically

A single beauty shot hides the back, inner armpits, and joint pivots. Instead of asking an artist to model from scratch, we generate an equal-height turnaround + separated exploded component kit. Python extracts each island, computes bone anchors, and compiles a bendable .ic rig in under a second.

Prompt D Turnaround and 13 Kit Parts
Prompt D · Kit Sheet Equal-height Front/Side/Back + 13 clean isolated parts.
Compiled 13-Part 3D Explodable Kit
Compiled 13-Part Kit titan-exploded-kit.ic with live explode & bend sliders.
Prompt E YAML Parametric Sheet
Prompt E · Parametric Maps Sphere / Capsule / Box parts onto skeletal bones.
Compiled 18-Primitive Skeleton
18-Part CSG Rig (2.4 KB) titan-parametric.ic compiled cleanly by schematic_to_ic.py.
Prompt B 9-Color Part-ID Sheet
Prompt B · 15-Joint RGB ID Flat RGB palette auto-carves 15 limb meshes (titan-partid.ic).
Prompt A Clean CAD 3-View Ortho
Prompt A · Clean 3-View Ortho Front × Side visual hull carved in 0.28s (2,505 verts, 5,032 tris).
Prompt C 8-Way Isometric Sprite Strip
Prompt C · 8-Way Isometric Strip (2048×256) 8 chroma-keyed 30° isometric views + 19,182-voxel visual hull.
3. Engineering Reality Check

Where we actually stand — honest parity & SSOT roadmap

On flagship 3/4 framing, Euler Titan reaches 90.6% silhouette IoU and 82/100 blind parity, and Brass Inf Mech scores 78/100 (weathered teal/bronze patina & Strategy-5 CSG). To reach true 100/100 SSOT across all characters, we are consolidating separate JS (`meta-kit.js`), WebGL2 (`ic-sdf-shot.js`), and `.ic.md` ASCII files under one single `@PART` compiler.

CapabilityWhere We Are NowNext Concrete Fix for 100/100 SSOT
Exact Silhouette & Shader Parity
sdf-studio.html?wipe=1
Euler: 90.6% IoU (82/100)
Brass: 70.6% IoU (78/100)
Match trailer teal patina/rune etchings, open 3-prong claws, larger centered e^x chest decal, and Euler T-visor eyes.
Unified Roster & Crisp Primitives
core/ic-sdf-shot.js
Shared Strategy-5 CSG
No blurry DCT blobs on Hero Cards
Replaced legacy DCT voxel stumps on Poly Hydra & Unit Circle Mech with clean Strategy-5 CSG shared between Spec & Rig Studio.
Natural Combat Motion Sources
tools/assets/motion.py + calcy_anim_dsl.py
Procedural + Video Extractor
Optical pose tracking + Guitar-Tab @TIMELINE
Retarget AI video / Mixamo humanoid BVH cycles onto our shared humanoid pivot hierarchy (pelvis → chest → shoulder → elbow → fist), plus spring follow-through on pods & cables.
Compounding Roster Scaling
flywheel_priors.json
5.7× Speedup Verified
(302 → 53 camera evals in 0.9s)
Every solved hero teaches camera pitch & proportion priors to the next boss; ComfyUI multi-view + baked palette generalizes across the whole roster.
4. Try It Live On This Page Runs locally on 54 KB /vendor/ic-3d/ic-3d.js

Live .ic.md & .ic Compiler Workbench

Default loads the V10 Strategy 5 Euler Titan (90.3% IoU) from its readable .ic.md ASCII blueprint + .ic parts & 3D-DCT spectral field. Edit any CSG part, color, or timeline below and click Compile & Rebuild.

Initializing ic-3d compiler...
Drag: Orbit · Scroll: Zoom · Voronoi PBR + LatheGeometry
Live ASCII Readback:

      
04_euler_titan.ic.md (V10 Live Source)
5. Under the Hood · ComfyUI + Blender

From raw trailer frame to fitted math geometry

We never ship raw ComfyUI meshes (a single TRELLIS.2 export is 31–365 MB with faint voxel stair-stepping). Instead, ComfyUI acts as our 3D geometric oracle: BiRefNet cuts the subject out cleanly, TRELLIS.2 recovers 360° volume, Blender inspects the clay pass, and our backsolver fits crisp 1.5 KB .ic primitives to it.

Trailer Frame Input
1. Trailer Source FrameMulti-object desk scene with HUD banners.
Tight Hero Crop
2. Tight Subject CropIsolates hero before segmentation.
BiRefNet Cutout
3. BiRefNet Cutout1024×1024 clean silhouette mask.
ComfyUI Front Render
4. TRELLIS.2 3D MeshCanonical front pose reconstructed in 3D.
Blender Front
Front (0°)Studio light rig
Blender 3/4
3/4 View (38°)Core bevel check
Blender Side
Side (90°)Limb depth check
Blender Back
Back (180°)Rear armor check
Blender Clay Pass
Clay PassPure geometry only
ArtifactDisk SizeRole in Pipeline
golem_trellis2.glb365 MBRaw O-Voxel reference mesh (6.35M verts)
golem_trellis2.sdf.json2.0 MBNormalized 80³ signed-distance training grid
assets/golem.ic1.5 KBShipped math recipe compiled in RAM
assets/calcy.ic2.9 KBHero parametric SDF + materials
assets/arrow-mech.ic526 BUltra-compact mech recipe
In-Game Three.js Golem
Shipped Runtime Look (Procedural .ic) Crisp analytic bevels and procedural emissive veins — 240,000× smaller than the raw GLB.
4-Boss Audit Sheet & Exact M5 Max Commands
4x4 Trailer Recreation Sheet
4×4 Multi-Boss AuditInfinity Golem, Unit Circle Mech, Polynomial Hydra & Trailer Calcy.
SubjectGLB → SDFSilhouette / 360° / SurfaceRecommended .ic Strategy
Infinity Golem365 MB → 2.0 MB8.5 / 7.5 / 5.0Voxel/chiseled CSG + crisp procedural magma & math plaque.
Unit Circle Mech31.1 MB → 2.36 MB7.0 / 7.0 / 4.5Smooth parametric CSG arcs, protractor ticks & lens glow.
Polynomial Hydra68.1 MB → 2.47 MB6.0 / 6.0 / 4.0Mask plinth pre-3D; rebuild multi-heads with axis-aligned cubes.
Trailer Calcy47.9 MB → 1.99 MB8.0 / 6.5 / 4.0Smooth beveled box + procedural LCD face & keypad array.
# 1. Launch ComfyUI on Apple Silicon (MPS diffusion + --cpu-vae to avoid Conv3D hang)
/Users/kazad/ComfyUI-Installs/ComfyUI/ComfyUI/.venv/bin/python3 \
  /Users/kazad/ComfyUI-Installs/ComfyUI/ComfyUI/main.py \
  --listen 127.0.0.1 --port 8188 --cpu-vae --disable-auto-launch

# 2. Isolate subject + lift GLB via TripoSR & sample SDF grid
python3 tools/assets/isolate.py hero_crop.png ./out/
python3 tools/assets/mesh.py ./out/isolate.png ./out/asset.glb
python3 tools/assets/mesh-sdf.py ./out/asset.glb ./out/asset.sdf.json

# 3. Fit procedural .ic asset against normalized SDF + refine render parity (CMA-ES + .ic loss)
node tools/assets/mesh2ic.mjs program.ic ./out/asset.sdf.json views.json view_id out.ic --evals 1500
node tools/assets/fit.mjs asset_name out.ic views.json ./out/fit
6. Math-Native Primitives & Cozy Roster

Compact equations beat triangle soup every time

Every silhouette on the graph paper reduces to four clean mathematical building blocks—revolutions, swept Bézier curves, Fourier ridges, and damped envelopes—keeping the entire hero lineup tiny, razor-sharp, and warm.

Lathe Profile r(y)

r(y) = Bezier 24 segs, ~45 B Armor / Horns

Swept Bézier C(t)

12 floats = limb

Fourier Ridge Folds

|sin(k·p)| fissures Zero textures, infinite LOD

Laplace Envelope

exp(-σr) · f(r) Smooth bevels, crisp rims
Shared Renderer SSOT — Identical Look Across Spec & Rig Studio: Calcy Hero renders on page load via calcy-real.ic (509 B) + meta-kit.js; all 4 bosses below render via the exact same shared Strategy-5 shaders in ic-sdf-shot.js used in Rig Studio (zero pre-baked PNGs).
02. Calcy Hero509 B calcy-real.ic → meta-kit
04. Euler Titan950 B csg_dct + WebGL2 CSG
08. Brass Inf Mech924 B .ic · weathered patina
03. Poly Hydra3-neck voxel CSG · Strategy 5
06. Unit Circle MechTwin 180° protractors + compass
95 Procedural Geometry, Shader & Look-Dev Checklist (42 Shipped / 19 Partial / 34 Queued)

Compression Funnel (Euler & Brass Mech)

  • JPG 41–79 KB static 2D concept still (42 KB Brass / 79 KB Euler)
  • GLB 1.7 MB raw unrigged TRELLIS.2 triangle soup
  • .ic (dct2) 3.1–3.2 KB (-87.4%) two-band spectral SDF
  • csg_dct 924–1,014 B (-96.3%) 19 oriented primitives + int8 residual

Compact DSL Words (351–918 B Bosses)

  • radial(n, r, tilt, part) — rings, spines & halos in 1 line
  • tube(pts, r1, r2) — swept flexible limbs, tails & coils
  • gear, rev, stack — clockwork, bells & golems

Spectral, SDF & Node Tricks (1–40)

  • YES 1D Fourier lathe profiles for boots & pedestals
  • YES Band-limited Worley lava fissures & cracks
  • YES LimbChain, MirrorX, SocketSnap, RivetArray
  • YES Tapered trapezoidal plates & recessed panel seams
  • PART Superquadric gloves, radial Fourier shields & tread splines
  • QUEUE 3D spherical harmonics & silhouette IoU optimizer

4-Map PBR, Lighting, Rigging & Compiler (41–100)

  • YES Triplanar 3D Voronoi + curvature edge wear + crevice AO
  • YES Strict 8:1:3 warm key / cool sky fill / rim + contact shadow
  • YES Asymmetric hero stance + instanced sub-assemblies
  • PART 2-bone IK limbs, GLSL math symbol SDFs, joint validators
  • QUEUE Secondary spring bounce, GTAO pass & auto-IK retargeting
7. Literate Source Format

Every model is a readable Markdown file (*.ic.md)

Splitting topology (@SKELETON in 7-bit ASCII), profile curves (<svg>), PBR surface bands (@MATERIAL_TAB), and keyframe timing (@TIMELINE) lets humans and AI inspect or edit a 3D boss directly in Git diffs or any browser.

60 FPS Live @TIMELINE Articulation Rigid waist-hinge & shoulder-slam joints + magma flare driven on euler-titan-1kb.ic (950 B) · SSOT in 04_euler_titan.ic.md (5,151 B).
Guitar-Tab Timeline Strip
Guitar-Tab Keyframes /windup → *SLAM* + *FLARE* → \recoil across 60 fps bones.
Inspect Full Literate 04_euler_titan.ic.md Source
# 04. Euler Exp Titan (`04_euler_titan.ic.md`)

```ic-skeleton
@SKELETON euler_exp_titan (unit: 0.1m)
          [HEAD]          -> lathe(#helmet_crest) + extrude(#t_visor)
            |
    (o)---[TORSO]---(o)   -> lathe(#chest_plate) + decal(#ex_badge)
    /        |        \
  [PAUL]    (o)     [PAUL] -> lathe(#pauldron)
   |       /   \       |
  [ARM] [THIGH][THIGH][ARM] -> lathe(#bicep_armor)
   |       |     |     |
 [FIST] [GREAV][GREAV][FIST] -> extrude(#molten_fist)
           |     |
        [PEDESTAL]         -> lathe(#stepped_pedestal) + decal(#plaque_2)
```

```ic-shader
obsidian_lava : objectSpaceVoronoi(warp=7.5, core=#ff5c08, crust=#252221)
pedestal_stone: cozyClay(base=#6c6862, seams=true)
```