Recorded runs · real API calls · every printed number computed or checked by code
Read a ship's draft from ten seconds of video. Compute only with a program that reproduced the booklet's printed conditions.
SAM 3.1 tracks the painted draft numerals and the water surface in every frame; code averages the waterline through the swell into one draft with a stated uncertainty. Muse Spark 1.3 reads the mark labels and five code checks confirm them. Muse Wonder 1.0 wrote the survey program from a stability booklet, and that program had to reproduce the booklet's printed conditions before it may compute.
Live on this page, no code: the self-test re-run of Wonder's program in the sandbox. Recorded: the SAM 3.1 and Spark 1.3 outputs (response ids on /evidence). Weight accuracy is synthetic only; no physical scale check yet. Prototype, not a surveyor's certificate.
Marks as read on dB7X_t45; the line is its wave-averaged draft.
Proof 1 of 2
Measurement: video → draft
Does the clip give a stable, honest draft? Real hull clips have no ground truth, so only repeatability is stated; the synthetic barge checks the arithmetic against known geometry.
Real hull test clip dB7X_t45 (no ground truth)
- Repeatability u (k=1)
- ± 0.0864 m
- Absolute u (k=1)
- not stated — no ground truth
- u parts
- swell 0.0864 · random 0.0011
- Frames kept
- 60 / 60
- Dropped (reason)
- none
- Neff · lag-1 ρ
- 3.55 · 0.888
- Swell p5–p95
- 12.562 – 13.052 m
- One-pitch label shift
- moves d by 0.20 m
Mark labels
Read by muse-spark-1.3 on 2 frames; code checks decide.
| Token | read · frame 0 | read · frame 10 | Confirmed | Draft (m) |
|---|---|---|---|---|
| t8 | 6 | 6 | 6 | 12.6 |
| t3 | 8 | 8 | 8 | 12.8 |
| t1anchor | 13M | 13M | 13M | 13.0 |
| t6 | 2 | 2 | 2 | 13.2 |
| t4 | 4 | 4 | 4 | 13.4 |
| t2 | 6 | 6 | 6 | 13.6 |
| t0 | 8 | 8 | 8 | 13.8 |
| t5anchor | 14M | 14M | 14M | 14.0 |
| t7 | 2 | 2 | 2 | 14.2 |
- monotone passed
- pitch passed
- residual passed
- cross-frame passed
- anchor passed
pitch 66.73 px · fit residual 0.44 px · shared tokens 9
Known blind spot: a consistent whole-metre misread passes all five checks, so a live run asks you to confirm the anchor crop before the reading is used.
Certificate decision
The draft is outside the vessel's hydrostatic table: the program refuses to extrapolate.
- sam-3.1 · 60 frames · 6.9 s · $0.012
- sam-3.1 · 60 frames · 8.2 s · $0.012
- muse-spark-1.3 · 1409 tok · 4.8 s · $0.0046
- muse-spark-1.3 · 2930 tok · 9.8 s · $0.011
Real hull test clip UKTRQ_t20 (no ground truth)
- Repeatability u (k=1)
- ± 0.0547 m
- Absolute u (k=1)
- not stated — no ground truth
- u parts
- swell 0.0547 · random 0.0057
- Frames kept
- 46 / 48
- Dropped (reason)
- NO_WATER_EDGE × 2
- Neff · lag-1 ρ
- 2.91 · 0.881
- Swell p5–p95
- 20.670 – 20.970 m
- One-pitch label shift
- moves d by 0.20 m
Mark labels
Read by muse-spark-1.3 on 2 frames; code checks decide.
| Token | read · frame 17 | read · frame 29 | Confirmed | Draft (m) |
|---|---|---|---|---|
| t12 | 6 | — | 6 | 20.6 |
| t8 | 8 | — | 8 | 20.8 |
| t4anchor | 21M | — | 21M | 21.0 |
| t7 | 2 | 2 | 2 | 21.2 |
| t11 | 4 | 4 | 4 | 21.4 |
| t1 | 6 | 6 | 6 | 21.6 |
| t2 | 8 | 8 | 8 | 21.8 |
| t0anchor | 22M | 22M | 22M | 22.0 |
| t5 | 2 | 2 | 2 | 22.2 |
- monotone passed
- pitch passed
- residual passed
- cross-frame passed
- anchor passed
pitch 60.27 px · fit residual 4.00 px · shared tokens 6
Known blind spot: a consistent whole-metre misread passes all five checks, so a live run asks you to confirm the anchor crop before the reading is used.
Certificate decision
The draft is outside the vessel's hydrostatic table: the program refuses to extrapolate.
- sam-3.1 · 48 frames · 7.4 s · $0.0096
- sam-3.1 · 48 frames · 7.8 s · $0.0096
- muse-spark-1.3 · 1887 tok · 6.6 s · $0.0070
- muse-spark-1.3 · 11932 tok · 39.4 s · $0.050
Mini-barge, SYNTHETIC geometry (seed 3; not SAM, not the scale)
- Repeatability u (k=1)
- ± 0.0019 m
- Absolute u (k=1)
- ± 0.0019 m
- u parts
- swell 0.0019 · random 0.0000 · scale 0.0004 · edge 0.0001 · par 0.0003
- Frames kept
- 58 / 60
- Dropped (reason)
- NO_LABELLED_MARKS × 2
- Neff · lag-1 ρ
- 6.39 · 0.801
- Swell p5–p95
- 0.1024 – 0.1153 m
- One-pitch label shift
- moves d by 0.02 m
Mark labels
Synthetic labels: no model read these marks.
| Token | Confirmed | Draft (m) |
|---|---|---|
| t4anchor | 1M | 0.10 |
| t5 | 2 | 0.12 |
| t6 | 4 | 0.14 |
| t7 | 6 | 0.16 |
| t8 | 8 | 0.18 |
- monotone passed
- pitch passed
- residual passed
- cross-frame passed
- anchor passed
pitch 119.75 px · fit residual 0.00 px · shared tokens 5
Known blind spot: a consistent whole-metre misread passes all five checks, so a live run asks you to confirm the anchor crop before the reading is used.
Certificate decision
- U_ABOVE_PASS_BAND 2u exceeds 2 % of the cargo: the result cannot show a +-2 % pass. (2u = 4.26 % of cargo)
Proof 2 of 2
Program: booklet → survey program
Agent loop: Wonder writes the program → the sandbox grades it on the booklet → failing ids and its own intermediates (or the gate error) go back → it rewrites (2 repairs).
Wonder's survey program proves itself on the Trieste booklet (no scale truth)
Self-test on the printed conditions
PASS22/22 printed conditionsout-of-table probes refused 2/2vs our reference program, 200 cases · max difference 7.1e-5 % · 0 failures
| Condition | Page | Printed t | Program t | Error % | Result | First diverging |
|---|---|---|---|---|---|---|
| 1 | 101 | 11,244.1 | 11,244.7 | 0.0055 | PASS | — |
| 2.1 | 108 | 15,082.0 | 15,081.0 | -0.0063 | PASS | — |
| 2.2 | 117 | 13,664.7 | 13,662.1 | -0.0191 | PASS | — |
| 3.1 | 126 | 15,984.0 | 15,980.6 | -0.0210 | PASS | — |
| 3.2 | 137 | 15,140.1 | 15,133.5 | -0.0438 | PASS | — |
| 4.1 | 148 | 17,827.7 | 17,825.8 | -0.0106 | PASS | — |
| 4.2 | 159 | 16,955.3 | 16,953.6 | -0.0099 | PASS | — |
| 4.3 | 170 | 17,265.7 | 17,265.2 | -0.0029 | PASS | — |
| 4.4 | 181 | 17,283.1 | 17,282.7 | -0.0022 | PASS | — |
| 4.5 | 192 | 17,319.8 | 17,318.2 | -0.0090 | PASS | — |
| 4.6 | 203 | 16,808.5 | 16,808.7 | 0.0011 | PASS | — |
| 5.1 | 214 | 17,035.4 | 17,034.3 | -0.0066 | PASS | — |
| 5.2 | 225 | 15,650.9 | 15,649.4 | -0.0097 | PASS | — |
| 6.1 | 236 | 17,057.4 | 17,057.1 | -0.0020 | PASS | — |
| 6.2 | 247 | 15,673.0 | 15,670.9 | -0.0136 | PASS | — |
| 7.1 | 258 | 16,516.9 | 16,517.7 | 0.0050 | PASS | — |
| 7.2 | 269 | 15,132.5 | 15,129.3 | -0.0214 | PASS | — |
| 8.1 | 280 | 16,569.3 | 16,570.8 | 0.0089 | PASS | — |
| 8.2 | 291 | 15,184.8 | 15,182.5 | -0.0148 | PASS | — |
| 9.1 | 302 | 16,785.0 | 16,782.3 | -0.0158 | PASS | — |
| 9.2 | 313 | 15,400.6 | 15,391.4 | -0.0599 | PASS | — |
| 10 | 324 | 11,959.1 | 11,958.0 | -0.0092 | PASS | — |
How the program was earned
PASS22/22 printed conditionsdifferential max error 7.1e-5 %
0.89 min · $0.175 · 21912 tokens · resp_6ae5a63a238297fff10f457e · sha 4b3aa8cd9487…
Prompt = booklet pages + input drafts only (no standards hint). Attempt 1 rejected by the static gate, attempt 2 passed 14/22 (no second trim correction), attempt 3 passed 22/22 after feedback with failing cond ids + its own intermediates. A second run with a one-sentence UNECE hint (run-unece-hint/) passed 22/22 on attempt 1.
Proven program source (234 lines)
import math
import bisect
import re
def _num(text):
return float(str(text).replace(",", "").rstrip("fF"))
def _interp(rows, drafts, x, key):
if x <= drafts[0]:
if x == drafts[0]:
return float(rows[0][key])
x0 = drafts[0]
x1 = drafts[1]
y0 = float(rows[0][key])
y1 = float(rows[1][key])
return y0 + (y1 - y0) * (x - x0) / (x1 - x0)
if x >= drafts[-1]:
if x == drafts[-1]:
return float(rows[-1][key])
x0 = drafts[-2]
x1 = drafts[-1]
y0 = float(rows[-2][key])
y1 = float(rows[-1][key])
return y1 + (y1 - y0) * (x - x1) / (x1 - x0)
i = bisect.bisect_left(drafts, x)
if drafts[i] == x:
return float(rows[i][key])
x0 = drafts[i - 1]
x1 = drafts[i]
y0 = float(rows[i - 1][key])
y1 = float(rows[i][key])
return y0 + (y1 - y0) * (x - x0) / (x1 - x0)
def parse_booklet(booklet):
pages = booklet.get("pages", {}) if isinstance(booklet, dict) else {}
ordered = []
for key in sorted(pages.keys(), key=lambda z: int(z) if str(z).isdigit() else 9999):
ordered.append(str(pages[key]))
text = "\n".join(ordered)
lpp = 150.0
m = re.search(r"Length Between Perpendiculars\s+([0-9]+(?:\.[0-9]+)?)\s*m", text)
if m:
lpp = float(m.group(1))
loa = None
m = re.search(r"Length Overall\s+([0-9]+(?:\.[0-9]+)?)\s*m", text)
if m:
loa = float(m.group(1))
breadth = None
m = re.search(r"Breadth Molded\s+([0-9]+(?:\.[0-9]+)?)\s*m", text)
if m:
breadth = float(m.group(1))
standard_sg = 1.025
m = re.search(r"Water Specific Gravity\s+([0-9]+(?:\.[0-9]+)?)", text)
if m:
standard_sg = float(m.group(1))
fore_corr = 1.2
aft_corr = 8.8
corr_divisor = 140.0
pairs = re.findall(
r"([0-9]+(?:\.[0-9]+)?)\s*\*\s*\(\s*\(\s*da\s*-\s*df\s*\)\s*/\s*([0-9]+(?:\.[0-9]+)?)\s*\)",
text,
)
if len(pairs) >= 2:
fore_corr = float(pairs[0][0])
corr_divisor = float(pairs[0][1])
aft_corr = float(pairs[1][0])
elif len(pairs) == 1:
fore_corr = float(pairs[0][0])
corr_divisor = float(pairs[0][1])
rows = []
seen = {}
for page_text in ordered:
for line in page_text.splitlines():
s = line.strip()
mm = re.match(r"^([0-9]+\.[0-9]{3})\s+(.+)$", s)
if not mm:
continue
draft = float(mm.group(1))
toks = mm.group(2).split()
# Columns: Displ LCB VCB LCF TPcm MTcm(/deg) KML KMT
# KML may be printed with a thousands space, e.g. "1 394.363".
if len(toks) < 8:
continue
try:
displ = _num(toks[0])
lcb = _num(toks[1])
vcb = _num(toks[2])
lcf = _num(toks[3])
tpcm = _num(toks[4])
mt_deg = _num(toks[5])
rest = toks[6:]
if len(rest) == 3:
kml = _num(rest[0] + rest[1])
kmt = _num(rest[2])
elif len(rest) == 2:
kml = _num(rest[0])
kmt = _num(rest[1])
else:
continue
except ValueError:
continue
# Hydrostatic drafts in this booklet are 0.500 to 9.300 m.
if draft < 0.4 or draft > 9.4:
continue
row = {
"draft": float(draft),
"displ": float(displ),
"disp": float(displ),
"lcb": float(lcb),
"vcb": float(vcb),
"lcf": float(lcf),
"tpcm": float(tpcm),
"mtcm_deg": float(mt_deg),
"mtcm": float(mt_deg),
"kml": float(kml),
"kmt": float(kmt),
}
seen[float(draft)] = row
for d in sorted(seen.keys()):
rows.append(seen[d])
ship = {
"lpp": float(lpp),
"lbp": float(lpp),
"loa": float(loa) if loa is not None else float(lpp),
"breadth": float(breadth) if breadth is not None else 0.0,
"standard_sg": float(standard_sg),
"sg_standard": float(standard_sg),
"fore_corr": float(fore_corr),
"aft_corr": float(aft_corr),
"corr_divisor": float(corr_divisor),
"draft_mark_divisor": float(corr_divisor),
"hydrostatic": rows,
"hydro": rows,
}
return ship
def survey(inputs, ship):
fore_p = float(inputs["fore_p"])
fore_s = float(inputs["fore_s"])
mid_p = float(inputs["mid_p"])
mid_s = float(inputs["mid_s"])
aft_p = float(inputs["aft_p"])
aft_s = float(inputs["aft_s"])
sg = float(inputs["sg"])
rows = ship["hydrostatic"] if "hydrostatic" in ship else ship["hydro"]
drafts = [float(r["draft"]) for r in rows]
lpp = float(ship["lpp"]) if "lpp" in ship else float(ship["lbp"])
standard_sg = float(ship["standard_sg"]) if "standard_sg" in ship else 1.025
fore_corr = float(ship["fore_corr"]) if "fore_corr" in ship else 1.2
aft_corr = float(ship["aft_corr"]) if "aft_corr" in ship else 8.8
divisor = float(ship["corr_divisor"]) if "corr_divisor" in ship else 140.0
df = (fore_p + fore_s) / 2.0
dm = (mid_p + mid_s) / 2.0
da = (aft_p + aft_s) / 2.0
# Booklet page 21: corrections from draft marks to FP / AP.
# The divisor 140 m is the distance used in that printed formula,
# not Lpp (150 m).
apparent_trim = da - df
d_fp = df - fore_corr * (apparent_trim / divisor)
d_ap = da + aft_corr * (apparent_trim / divisor)
d_ms = dm
trim = d_ap - d_fp
d_mm = (d_fp + 6.0 * d_ms + d_ap) / 8.0
d_mean_ends = (d_fp + d_ap) / 2.0
if d_mm < drafts[0] or d_mm > drafts[-1]:
raise OutOfTable("mean draft outside hydrostatic table")
disp_table = _interp(rows, drafts, d_mm, "displ")
tpcm = _interp(rows, drafts, d_mm, "tpcm")
lcf = _interp(rows, drafts, d_mm, "lcf")
lcb = _interp(rows, drafts, d_mm, "lcb")
mt_deg_mean = _interp(rows, drafts, d_mm, "mtcm_deg")
# First trim correction, booklet page 22, item 3:
# D2 = t * TPcm * 100 * (Lpp/2 - LCF) / Lpp (LCF from AP)
corr_trim1 = trim * tpcm * 100.0 * (lpp / 2.0 - lcf) / lpp
# Second (Nemoto) trim correction. This is required to reproduce
# the printed trimmed loading conditions, especially at large trim.
# The table column headed MTcm is in MT-m/deg (see Sheet No.1:
# "MTcm : (MT-m/deg)"). Convert moment per degree to moment per cm:
# a trim of 1 degree is Lpp*100*tan(1 deg) cm of trim.
# Corr2 = 50 * trim^2 / Lpp * (MCT at d+0.50 m - MCT at d-0.50 m)
# with MCT in MT-m/cm. Values at d +/- 0.50 m are interpolated;
# linear extrapolation from the end interval is used only for the
# +/-0.50 m points if the mean draft itself is inside the table.
cm_per_degree = lpp * 100.0 * math.tan(math.radians(1.0))
mt_plus_deg = _interp(rows, drafts, d_mm + 0.5, "mtcm_deg")
mt_minus_deg = _interp(rows, drafts, d_mm - 0.5, "mtcm_deg")
mt_plus = mt_plus_deg / cm_per_degree
mt_minus = mt_minus_deg / cm_per_degree
corr_trim2 = 50.0 * trim * trim * (mt_plus - mt_minus) / lpp
corr_density = (disp_table + corr_trim1 + corr_trim2) * (sg - standard_sg) / standard_sg
disp_final = disp_table + corr_trim1 + corr_trim2 + corr_density
return {
"d_fp": float(d_fp),
"d_ap": float(d_ap),
"d_ms": float(d_ms),
"trim": float(trim),
"d_mm": float(d_mm),
"d_m": float(d_mean_ends),
"disp_table": float(disp_table),
"corr_trim1": float(corr_trim1),
"corr_trim2": float(corr_trim2),
"corr_density": float(corr_density),
"disp_final": float(disp_final),
"df": float(df),
"dm": float(dm),
"da": float(da),
"tpcm": float(tpcm),
"lcf": float(lcf),
"lcb": float(lcb),
"mtcm": float(mt_deg_mean),
"mtcm_deg": float(mt_deg_mean),
"sg": float(sg),
}
Survey on printed condition 4.1
| Position | Draft m | Source | Weight | t per mm |
|---|---|---|---|---|
| Fore P | 6.2050 | entered | 0.0625 | 0.092 |
| Fore S | 6.2050 | entered | 0.0625 | 0.092 |
| Mid P | 6.5000 | entered | 0.3750 | 1.405 |
| Mid S | 6.5000 | entered | 0.3750 | 1.405 |
| Aft P | 6.7650 | entered | 0.0625 | 0.376 |
| Aft S | 6.7650 | entered | 0.0625 | 0.376 |
| d_fp | 6.2002 m |
|---|---|
| d_ap | 6.8002 m |
| d_ms | 6.5000 m |
| d_mm | 6.5000 m |
| trim | 0.6000 m |
| disp_table | 17,690.41 t |
| corr_trim1 | +125.59 t |
| corr_trim2 | +9.82 t |
| corr_density | +0.00 t |
| disp_final | 17,825.82 t |
- Displacement
- 17,825.8 t
- Deductions
- 0.0 t (none entered; not a measured empty ship)
- Net displacement
- 17,825.8 t
- Cargo
- not computed — needs a lightship constant or an initial net
u covers: draft + geometry uncertainty only — excludes entered drafts and deductibles
Booklet condition 4.1 (p. 148) prints 17,827.7 t; the program printed 17,825.8 t (-0.011 %).
Ro-Ro test ship: 1 cm at this draft = 36.99 t (illustrative, not a bulk carrier)
- POSITIONS_ENTERED Some draft positions were entered, not measured from a clip. (6 positions entered)
- muse-wonder-1.0 · attempt 1 · 33 s · $0.161
- muse-wonder-1.0 · attempt 2 · 33 s · $0.145
- muse-wonder-1.0 · attempt 3 · 53 s · $0.175