kernel&chai
Subscribe
The two builds side by side at sunrise, from the same camera: Codex on the left, Claude on the right.
← Lab

lab · build study · taj mahal

Two AIs built the Taj Mahal. I measured it.

I'm a civil engineer. I gave two AI coding tools the same brief, in empty folders, and checked their work: how wide is the dome, and who says so?

Scroll

Codex on the left, Claude on the right: same prompt, same camera, same light, every shape is code. Captures © Kernel & Chai. Rights

sizes the builds reported match my re-measure
22/22
Measured
inner dome, both builds; ASI gives 17.68 m
17.7 m
Measured1
outer dome: two scholarly sources disagree
26.9-33.6 m
Reported5
lines of code I edited in either build
0
Measured

Measured: my re-measure of both builds with the same harness. Reported: the published sources.

01 · the brief

What I asked for

Both tools got the same text: a spec and a brief. Codex received it as one message, Claude as two. Build the Taj Mahal in Three.js from code. Research the real dimensions yourself, cite every source, and say where sources disagree. Then review your own screenshots against the real Taj and fix the three biggest differences, four rounds in all.

Each one started fresh, in an empty folder, with web search on. I didn't touch the code. Claude asked one question, where to build, and I picked the option it recommended. Codex asked nothing.

Getting a clean run took two tries. On my first attempt, Codex could see my own research notes in a nearby folder, and it read them. I threw that run away and started Codex again in a folder with nothing else in it.

The spec and the brief, word for word

Same text for both tools.

1 · the spec, also saved as SPEC.md

# SPEC: what the Taj build must expose and deliver

## Scene rules
- Pure code. No 3D model files, image textures, HDRIs or downloaded assets. Three.js and its official add-ons only, vendored in this folder (no CDN at runtime). List the add-ons you use.
- Units are metres. The origin is the centre of the plinth top. +Y is up. +Z points toward the main gate (south).

## window.taj (available once the page script runs)
```js
window.taj = {
  ready: Promise<void>,                         // resolves after the first 3D frame is drawn
  views: ['front', 'oblique', 'plan', 'hero'],
  setView(name): void,                          // jump to that camera, no animation
  setSpin(on: boolean): void,                   // orbit around the dome axis, 1 turn per 40 s
  setTime('sunrise' | 'noon'): void,
  measure(): {                                  // metres, from mesh bounding boxes in world space, never from config constants
    plinthSide, plinthHeight, tombWidth, tombHeight,
    domeHeight, domeMaxDiameter,                // outer dome shell only (no drum, no finial)
    innerDomeDiameter, drumHeight,
    finialTop,                                  // finial tip above the plinth top
    minaretHeight, poolLength
  },
  stats(): { triangles, meshes, drawCalls, jsBytes }
};
```

## Fixed cameras
| View | Position (x, y, z) | Target | FOV |
|---|---|---|---|
| front | (0, 35, 260) | (0, 35, 0) | 35 |
| oblique | (170, 90, 170) | (0, 30, 0) | 35 |
| plan | (0, 320, 0.01) | (0, 0, 0) | 35 |
| hero | (60, 25, 210) | (0, 40, 0) | 40 |

## Page
- Poster first: a still of the hero view's first sunrise frame. 3D starts on tap.
- `?embed=1`: no page text or buttons at all, just the scene; it starts 3D at once (the parent page gives the user gesture). `?autostart=1` skips the poster.
- No network requests except this folder's own files. No server, no upload or save endpoint.
- Phone: under 150,000 scene triangles on a 390 px wide screen.

## Deliver in this folder
index.html, src/, vendor/, poster image, sources.json (one row per value you used: value, what it measures, status cited | assumption | disputed, source URL), measurements.json (measure() and stats() at 390 px and 1440 px), screenshots/ (the four fixed cameras at 1440x900, sunrise), CHANGES.md (what you built, your self-audit of measure() against sources, known limits), PROMPTS.md (every prompt you received, word for word). Do not put repository URLs, account names or personal names in any file.

2 · the brief

Message 1 (once, at the start):
Build the Taj Mahal in Three.js, entirely from code, in this folder. Follow SPEC.md exactly.

Research the real dimensions yourself from published sources. Prefer the Archaeological Survey of India, UNESCO and peer-reviewed papers. Every dimension you use goes into sources.json with what it measures, its status and the source URL. Where sources disagree, say so; don't pick silently.

Get the proportions right: the raised plinth, the main tomb with its pishtaq arches, the double dome (outer onion shell and inner dome) on its drum, the finial, the four chhatris, the four minarets, the mosque and the jawab, the char bagh garden with its water channels, and the long reflecting pool. Sunrise light, white marble. Make it beautiful enough to stop someone scrolling.

After each round, take the four fixed-camera screenshots, look at them, compare them with the real Taj Mahal, and commit "round N: <what changed>". Log every prompt you receive in PROMPTS.md.

Message 2 (send it exactly 3 times, each time after the tool finishes):
Look at your latest screenshots and compare them with the real Taj Mahal. Fix the three biggest differences, keep SPEC.md working, take new screenshots, and commit as the next round.

Message 3 (once, at the end):
Finish: run measure() and stats() at 390 px and 1440 px, write measurements.json and CHANGES.md with your self-audit against sources.json, and commit "final".

Claude's one question

Where to build and commit, because the folder I had attached also held other projects.

I picked: New isolated folder (Recommended)

02 · the builds

What came back

Tap a build to load it live. The camera buttons move both at once.

Codex

Codex · fair run · empty folder

Showing a still. Tap it to load the live 3D.

My first look

A bright, crisp model with deep arched niches, jali screens in the windows and a river behind the tomb. The mosque has three domes and arched bays. The light is closer to a clear morning than a sunrise.

Triangles on a phone
126,556
Draw calls on a phone
162
JavaScript loaded
0.83 MB

What it leaves out

No interior, calligraphy or fine carving. It lowered the facade to fit its own reading of one ASI height, and says that reading is not confirmed.

Claude

Claude · fair run · empty folder

Showing a still. Tap it to load the live 3D.

My first look

A warm sunrise, a tree line across the river and long shadows on the plinth. The facade has deep iwans with half-dome hoods, and the side buildings are red sandstone. Its dome is the slimmer of the two.

Triangles on a phone
128,833
Draw calls on a phone
138
JavaScript loaded
0.78 MB

What it leaves out

No interior, calligraphy or fine carving. It leans on Wikipedia and popular sites for many sizes.

03 · the method

How I checked

I didn't judge the pictures. I measured the models. Both builds report their sizes from their own geometry, not from a settings file. I re-measured both on my machine with the same four cameras and the same renderer. All 22 numbers matched what the two builds reported about themselves.

Then I compared each size with published sources: the Archaeological Survey of India (ASI), which runs the site6 , and peer-reviewed papers2 5 7 . I score a size only when the sources agree on both the number and what it measures. Everything else I show, but I don't score.

I also looked at where each tool got its numbers. Codex cited the official ASI site and a structural study of the dome for almost everything. Claude cited Wikipedia most often, plus a survey paper and a few popular sites.

Archnet3 , a common reference, blocks automated access. I haven't checked its values by hand yet, so I don't rely on them.

Reported vs re-measured

22 of 22 match
Each build's self-reported sizes against my re-measurement, in metres.
Size, mCodexClaude
Plinth (platform) side 95.65✓ matches95.69✓ matches
Plinth height 6.71✓ matches6.7✓ matches
Tomb width 57.82✓ matches56.9✓ matches
Tomb height: facade top above the plinth 27.7✓ matches33✓ matches
Outer dome height (shell only) 23✓ matches23✓ matches
Outer dome width 27.5✓ matches24.6✓ matches
Inner dome diameter 17.68✓ matches17.7✓ matches
Drum height 12✓ matches12✓ matches
Finial tip above the plinth top 67.1✓ matches67.97✓ matches
Minaret height 41.76✓ matches43.02✓ matches
Reflecting pool length 115✓ matches120✓ matches

Capture harness: Playwright 1.63.0, Chromium 153.0.8010.12, one WebGL renderer for both, 1440 × 900.

04 · the dome

The 17.6 m dome that isn't

This is the row I enjoyed most. One reference I started from gave the dome's width as 17.6 m. On my first try at this study, a build came out at twice that, and I thought it had got the dome badly wrong.

Then I read the ASI page. It gives a dome "58 feet in diameter", which is 17.68 m1 . But that is the inner dome, the ceiling you see from inside. The Taj has two domes, one inside the other. The white onion you see from the garden is the outer one, and it is much wider.

In the fair run, both tools worked this out on their own. Both built two shells, and both made the inner dome 17.7 m.

The outer dome is harder. Two scholarly sources disagree: a structural study gives about 26.9 m at its widest5 , and a paper that measured a photograph gets 33.6 m7 .

The outer domes and drums drawn to scale over each other, with the shaded source range: Codex 27.5 m wide, Claude 24.6 m wide.
Codex built 27.5 m, inside that range, from the structural study's drawing. Claude built 24.6 m, below it. Claude called this its weakest number, fitted to photographs. Neither is scored, because the sources disagree.

How a dome is made in code

In Three.js a dome is one curve, turned 360°. You draw half its outline as a list of points, and a "lathe" spins it around the vertical axis, like a potter's wheel. Change one number, the radius, and the whole dome gets wider. Drag the slider to see it.

The drawing uses Codex's own dome profile. Lathe code: Codex, src/architecture.js · Claude, src/geom.js.

One dome profile curve turned 360 degrees around a vertical axis The right half of the outline is a curve through 10 points. Mirrored, it gives the full dome. Each ellipse is the circle one point traces as the curve turns. A dimension line under the dome shows its widest width, which the slider sets. 17.6 m
8.8 m radius · 17.6 m wide

05 · the audit

The rest of the audit

Five sizes tell most of the story. Each card shows the source value or range, and where each build landed. Numbered sources are listed at the end.

  • Plinth side

    scored

    Codex 95.65 m. Claude 95.69 m. Sources: 95.4 m (ASI, Outlying Buildings), 95.69 m (Balasubramaniam 2009).

    95.4 m ASI, Outlying Buildings · 95.69 m Balasubramaniam 2009

    ASI gives 313 feet, 95.40 m, and a survey measured 95.69 m. Both builds sit between them: Codex 95.65 m, Claude 95.69 m.

  • Plinth height

    scored

    Codex 6.71 m. Claude 6.7 m. Sources: 6.71 m (ASI, Outlying Buildings).

    6.71 m ASI, Outlying Buildings

    ASI gives 22 feet, 6.71 m. Both builds match it: Codex 6.71 m, Claude 6.7 m.

  • Minaret height

    disputed

    Codex 41.76 m. Claude 43.02 m. Sources: 39.62 m (ASI, The Taj Exteriors), 41.76 m (ASI, Outlying Buildings).

    39.62 m ASI, The Taj Exteriors · 41.76 m ASI, Outlying Buildings

    ASI gives two figures on two pages, from "more than 130 feet" to 137 feet. Codex used exactly 137 feet, 41.76 m. Claude used 43.02 m, a survey figure via Wikipedia. Not scored.

  • Drum height

    disputed

    Codex 12 m. Claude 12 m. Sources: 7.01 m (ASI, The Taj Exteriors).

    7.01 m ASI, The Taj Exteriors

    Here both builds agree with each other and disagree with ASI. ASI says the drum is "roughly 23 feet", about 7 m. Both built 12 m. Codex chose it by eye and flagged the conflict. Claude took it from Wikipedia. ASI says "roughly" and doesn't say where it measures from, so I don't score it. But when two AIs agree, it's worth checking whether they agree with the source.

  • Reflecting pool

    no source

    Codex 115 m. Claude 120 m. No source.

    no source value

    I found no source I trust. Codex built 115 m and Claude 120 m. On my first try, the two builds made it 130 m and 282 m, so the brief made a difference.

Full audit: every row and every source11 rows
  • citedone clear source, or sources that agree
  • disputedsources or definitions disagree
  • no sourceno opened source gives a figure
Taj Mahal dimensions in metres. Build values are each build's own measure() output, or live values once a build is loaded.
DimensionCodexClaudeSourcesStatus
Plinth (platform) sideASI's 313 ft is 95.40 m. The surveyed value is 95.69 m. A 95.5 m figure from some references is 95.4 rounded. 95.65 m measurements.json -0.0% to +0.3% vs sources scored 95.69 m measurements.json +0.0% to +0.3% vs sources scored 95.4 m ASI, Outlying Buildings95.69 m Balasubramaniam 200993 m, not verified Archnet (not opened, manual check) cited
Plinth heightASI's 22 ft is 6.71 m. ASI states no datum. 6.71 m measurements.json -0.1% vs source scored 6.7 m measurements.json -0.1% vs source scored 6.71 m ASI, Outlying Buildings cited
Tomb widthASI measures the long sides of the chamfered octagon. The survey measures the square base. They may be different lines. Not scored. 57.82 m measurements.json +1.6% to +5.4% vs sources not scored 56.9 m measurements.json +0.0% to +3.7% vs sources not scored 54.86 m ASI, The Taj Interiors56.9 m Balasubramaniam 200954.9 m Rihal et al. 2021 disputed
Tomb height: facade top above the plinthNo opened source gives a pishtaq height. Archnet's 32.6 m still needs a manual check. Codex measures its facade to the central cornice, Claude to the top of the pishtaq frame, so the two values measure different lines. 27.7 m measurements.json 33 m measurements.json 32.6 m, not verified Archnet (not opened, manual check) no source
Outer dome height (shell only)Two profiles give 23.5 and 29.75 m above the drum. ASI's 44.4 m states no datum. Not scored. 23 m measurements.json -22.7% to -2.1% vs sources not scored 23 m measurements.json -22.7% to -2.1% vs sources not scored 44.4 m ASI, Overview29.75 m Ahuja and Rajani 201623.5 m Rihal et al. 202122.9 m Rihal et al. 202125.6 m, not verified Archnet (not opened, manual check) disputed
Outer dome widthA 17.6 m figure from one reference is the inner dome. The outer width is unresolved: two scholarly profiles give about 26.9 and 33.6 m, which look like one shape at two scales. Not scored. 27.5 m measurements.json -18.2% to +2.3% vs sources not scored 24.6 m measurements.json -26.8% to -8.5% vs sources not scored 33.62 m Ahuja and Rajani 201626.88 m Rihal et al. 202117.6 m, not verified Archnet (not opened, manual check) Context, inner dome: 17.68 m ASI, Outlying Buildings disputed, unresolved
Inner dome diameterASI gives "58 feet in diameter", 17.68 m. This is the ceiling seen from inside. 17.68 m measurements.json -0.0% vs source scored 17.7 m measurements.json +0.1% vs source scored 17.68 m ASI, Outlying Buildings cited
Drum heightASI gives "roughly 23 feet", about 7 m, and does not say where it measures from. Both builds used 12 m. Not scored. 12 m measurements.json 12 m measurements.json 7.01 m ASI, The Taj Exteriors disputed
Finial tip above the plinth topASI gives "nearly 200 feet" with no datum, so this is not scored. 67.1 m measurements.json 67.97 m measurements.json 60.96 m ASI, Outlying Buildings disputed
Minaret heightASI gives "more than 130 ft" on one page and 137 ft on another, with no datum. Not scored. 41.76 m measurements.json 43.02 m measurements.json 39.62 m ASI, The Taj Exteriors41.76 m ASI, Outlying Buildings disputed
Reflecting pool lengthNo opened source gives a pool length. 115 m measurements.json 120 m measurements.json no figure ASI, Taj Garden no source

Archnet could not be opened (HTTP 403 and 429), so its values still need a manual check in a browser. Every other source value shown was read on the page or in the paper.

Sources: ASI, Outlying Buildings · Balasubramaniam 2009 · Archnet (not opened, manual check) · ASI, The Taj Interiors · Rihal et al. 2021 · ASI, Overview · Ahuja and Rajani 2016 · ASI, The Taj Exteriors · ASI, Taj Garden · ICOMOS evaluation for UNESCO 252

06 · the process

How each one worked

Codex

Codex · fair run · empty folder

Codex ran in its command-line tool, in an empty folder, with web search on. It worked through all four rounds by itself. Its sources file reads like an engineer's: almost every value points to the ASI site or a peer-reviewed study, and it keeps the values it didn't use, marked as alternatives.

Its commits, as written

  1. r1establish procedural monument and fixed-view review
  2. r2expose drum and enrich marble detail and reflections
  3. r3refine niche scale dome silhouette and river setting
  4. r4correct vaults and camera geometry and finish architectural detail
  5. endfinal

Claude

Claude · fair run · empty folder

Claude ran in a chat with an empty folder from my Mac attached, with web search on. It also worked through all four rounds by itself. Its self-audit is the most useful part: for every size it shows the published range and says how solid its own number is.

Its commits, as written

  1. r1first complete build of the complex
  2. r2sunrise light, dome silhouette and drum, garden and terrace
  3. r3deep iwans with half-dome hoods, slimmer dome, tall pinnacles
  4. r4winter-sunrise light on the south facade, river and far bank, plinth paving
  5. endfinal

First round and final

The Codex build at the end, from its own hero screenshot: a dawn sky, a far river bank, the drum showing under the dome and water channels in the garden. The Codex build after round 1, from its own hero screenshot: the tomb, four minarets and a sandstone mosque under a pale, flat sky.
The Claude build at the end, from its own hero screenshot: warm sunrise light on the facade, deep iwans, a slimmer dome and a darker wooded far bank. The Claude build after round 1, from its own hero screenshot: the tomb, four minarets and a sandstone mosque on a red terrace grid, under a cool grey sky.

Drag each image: the tool's own hero screenshot after round 1, and after the last round, cropped the same way. Both tools later found that a camera limit had moved their early hero view slightly, so round 1 is framed a little differently.

my verdict

Same brief, same folders, same cameras, no human edits. I still name no winner: they made different, defensible choices, and the open rows need better sources, not a verdict.

07 · the first try

How we got here

Before the fair run, I tried a looser version. Each tool worked in a conversation that already had reference sizes, and I sent follow-ups to fix things. Those first builds taught me what to ask for: the same cameras, sizes measured from the model, the double dome named in the brief, and empty folders. You can still load them below.

Codex, first try

Codex · first try · reference-assisted

Showing a still. Tap it to load the live 3D.

Claude, first try

Claude · first try · reference-assisted

Showing a still. Tap it to load the live 3D.

08 · the orbits

Watch them turn

Both orbits use the same camera path, the same light and the same video settings. Press "Play both" to start them together.

Codex · hero orbit · 12 s · 720p · 1.7 MB
Claude · hero orbit · 12 s · 720p · 2.2 MB

Camera: the fixed hero view, setTime('sunrise'), setSpin(true) at one turn per 40 s, so 12 s covers 108°. Page: 1440 × 900, device scale 1, headless Chromium via Playwright 1.63.0, captured 15 Oct 2026. Encode: H.264 High, 1280 × 720, 30 fps, CRF 24, preset slow, no audio, centre-cropped from 16:10.

09 · next

What I'd check next

Three rows are still open: the outer dome, the drum and the total height. Ebba Koch's book "The Complete Taj Mahal" has a survey of every major size, and the Archnet page needs a manual check in a browser. When I've done both, I'll update the audit here and say what changed.

If you've stood in front of the Taj, which detail would you check first?

Read the write-up →

Sources

Each one says what it gives. Re-opened 21 Oct 2026: all resolve except Archnet. Archnet could not be opened (HTTP 403 and 429), so its values still need a manual check in a browser. Every other source value shown was read on the page or in the paper.

  1. Archaeological Survey of India, tajmahal.gov.in · accessed 15 Oct 2026

    Outlying Buildings (opens in a new tab) 

    Supports: Plinth (platform) side 95.4 m; Plinth height 6.71 m; Inner dome diameter 17.68 m; Inner dome height 24.69 m; Total height to finial tip, above plinth top 60.96 m; Minaret height 41.76 m.

    tajmahal.gov.inback to text for source 1

  2. Current Science 97(1), 42-49 · 2009 · Balasubramaniam

    New insights on the modular planning of the Taj Mahal (opens in a new tab) 

    Supports: Plinth (platform) side 95.69 m; Main tomb width 56.9 m; Screen octagon side 3.59 m; Char bagh garden size 296.31 m.

    Note: Scanned PDF: the Table 2 values were read by eye; they cannot be checked by text search.

    currentscience.ac.inback to text for source 2

  3. Archnet · not opened

    Taj Mahal (site 1557) (opens in a new tab) 

    Supports: Checked for plinth (platform) side, central pishtaq height, outer dome height, outer dome max diameter: no figure given.

    Note: Blocked automated access (HTTP 403 and 429). Its values are not used until checked by hand.

    archnet.orgback to text for source 3

  4. Archaeological Survey of India, tajmahal.gov.in · accessed 15 Oct 2026

    The Taj Interiors (opens in a new tab) 

    Supports: Main tomb width 54.86 m; Main hall octagon side 7.32 m; Main hall width across flats 17.67 m.

    tajmahal.gov.inback to text for source 4

  5. SAHC 2021 (Scipedia) · 2021 · Rihal, Koh, Mehrotra, Edmisten

    Structural Assessment of the Seismic Behavior of the Dome of the Taj Mahal (opens in a new tab) 

    Supports: Main tomb width 54.9 m; Outer dome height 23.5 m; Outer dome height 22.9 m; Outer dome max diameter 26.88 m; Outer dome base diameter 26.52 m.

    scipedia.comback to text for source 5

  6. Archaeological Survey of India, tajmahal.gov.in · accessed 15 Oct 2026

    Overview (opens in a new tab) 

    Supports: Outer dome height 44.4 m; Inner dome height 24.35 m.

    tajmahal.gov.inback to text for source 6

  7. Current Science 110(6), 996-999 · 2016 · Ahuja and Rajani

    On the symmetry of the central dome of the Taj Mahal (opens in a new tab) 

    Supports: Outer dome height 29.75 m; Outer dome max diameter 33.62 m; Outer dome base diameter 31.91 m.

    currentscience.ac.inback to text for source 7

  8. Archaeological Survey of India, tajmahal.gov.in · accessed 15 Oct 2026

    The Taj Exteriors (opens in a new tab) 

    Supports: Drum height 7.01 m; Minaret height 39.62 m; Riverfront terrace height 8.69 m; Riverfront terrace length 299.92 m.

    tajmahal.gov.inback to text for source 8

  9. Archaeological Survey of India, tajmahal.gov.in · accessed 15 Oct 2026

    Taj Garden (opens in a new tab) 

    Supports: Checked for reflecting pool length: no figure given.

    Note: Describes the pool but gives no length.

    tajmahal.gov.inback to text for source 9

  10. ICOMOS, for UNESCO World Heritage · May 1983

    Advisory body evaluation, No. 252 (Taj Mahal) (opens in a new tab) 

    Supports: Checked for char bagh garden size (area, context): no figure given.

    whc.unesco.orgback to text for source 10

The two builds are code written by Codex and Claude from my brief; the captures, renders and measurements are mine. Tool and product names belong to their owners. Captures and text © Kernel & Chai, all rights reserved; see Rights.

the newsletter

One explainer a week.

The week's video, written out properly, with sources. Nothing else. Unsubscribe in one click.

Watch on YouTube ↗