Description
Summary
spawn launch --estimate-only priced c8g.metal-48xl in us-east-1 at $0.2000/hr against
a real $7.6570/hr — 38× under — and quoted a 20-hour TTL at $4.00 against a real
$153.14. Measured today, spawn 0.101.0 (072c4b0), on a principal that can read the
Price List: the same launch, seconds later, stamped the correct rate on the instance
(spawn:price-per-hour=7.656960 on i-04194f1208ee1d602).
So this is not #533's IAM gap. The estimate path never asks. cmd/launch_single.go:298 calls
libs/pricing.GetEC2HourlyRate — the static guess table — unconditionally, with no live
lookup attempted and no fallback semantics involved. The correct rate was available, in
process, from the pricer the very next code path used.
#533 anticipated exactly this and deliberately deferred it ("The same table also feeds three
display surfaces … not filed as its own issue, so that this one is not held up behind a
cosmetic fix — because a fix here probably covers all four call sites"). It did not: #533's fix
landed on the enforcement side only (pkg/aws/pricing.go resolvePricePerHour, delegating to
truffle). Filing the deferred half so it is not lost, plus two things that are new.
New thing 1: fixing only the enforcement half inverted the direction of the harm
Before #533's fix, estimate and enforcement were consistently wrong in the same direction:
both said $0.20, so a cap sized from the estimate was enforced in the same fictional units and
merely failed to fire. After the fix they disagree by 38×, and only the wrong one is shown to
the human:
spawn launch gbb-p2 --instance-type c8g.metal-48xl --region us-east-1 --az us-east-1a \
--ttl 20h --cost-limit 200 ... --estimate-only
💰 Cost estimate for c8g.metal-48xl in us-east-1
On-demand: $0.2000/hr
TTL cost: $4.00 (20 hr)
✅ Estimate complete — no instances launched (--estimate-only)
A user who sizes --cost-limit from that output — which is what the output is for — picks
something around $5–10 for a 20-hour job. Enforcement now uses the true $7.6570, so
--cost-limit 5 fires at 39 minutes of a 20-hour sweep. The instance-hours are spent and
the run is incomplete: for a benchmark pass that is the whole cost with none of the result.
Pre-fix the same command overspent silently; post-fix it terminates early silently. Both are
spend-safety, and the second is not obviously the better one.
(This is why I dropped --cost-limit from the real launch and relied on --ttl alone. A limit
derived from a 38×-low rate reads as protection and provides none, in whichever direction it
turns out to be wrong.)
New thing 2: a second, larger mechanism — the metal size token
#533's measured cases all missed on basePriceLarge (unknown family → base = 0.10). This
one misses on sizeMultiplier too, and that term is the bigger one. ec2.go:222-238 has
exactly one metal key:
"48xlarge": 96.0,
"metal": 48.0,Every Graviton bare-metal size is spelled metal-24xl / metal-48xl, not metal. None of
them match, so they take multiplier = 2.0 // default to xlarge (ec2.go:246-249) — a 192-vCPU box priced as a
4-vCPU one. Decomposing c8g.metal-48xl:
| term | guessed | correct | error |
|---|---|---|---|
basePriceLarge["c8g"] |
0.10 (default) | 0.07976 (= 7.6570 / 96) | 1.25× over |
sizeMultiplier["metal-48xl"] |
2.0 (default) | 96.0 | 48× under |
| product | $0.2000 | $7.6570 | 38.3× under |
The two defaults partially cancel, which is what makes the result plausible rather than
absurd. And the size term is scale-free: it will be 48× low for metal-48xl on any family,
including families someone later remembers to add to basePriceLarge. Note metal: 48.0 is
correct for c5.metal (96 vCPU) and pricing/pricing_test.go:146-150 asserts it — so the
mechanism tests green on the one spelling AWS stopped using. pricing_test.go:141-145
("Unknown size (uses xlarge default)") asserts the 2.0 default itself as intended behaviour.
Measured: all five instance types in a live campaign, wrong in both directions
us-east-1, 2026-08-20. "Live" is truffle's Price List answer
(truffle find <type> --regions us-east-1 --show-price) — the same authority
resolvePricePerHour uses, so guess and truth here come from the two halves of spawn's own
pricing story.
| Instance type | vCPU | GetEC2HourlyRate |
truffle live | Error |
|---|---|---|---|---|
c8g.metal-48xl |
192 | $0.2000 | $7.6570 | 38.3× under |
c9g.metal-48xl |
192 | $0.2000 | $8.3462 | 41.7× under |
c8g.48xlarge |
192 | $9.6000 | $7.6570 | 1.25× over |
hpc7g.16xlarge |
64 | $3.2000 | $1.6832 | 1.90× over |
c7g.16xlarge |
64 | $3.2000 | $2.3200 | 1.38× over |
c6g.16xlarge |
64 | $3.2000 | $2.1760 | 1.47× over |
Five of those six are the host set of a real measurement campaign priced through spawn, and
not one is right. As #533 already noted, the sign flips by family, so a single spot-check
cannot tell you which side you are on — and here it flips within one campaign, so a user who
sanity-checks c7g.16xlarge (1.4× high, reassuringly conservative) concludes the estimator is
pessimistic right before it under-quotes the metal host by 38×.
Repro needs no AWS access at all:
pricing.GetEC2HourlyRate("us-east-1", "c8g.metal-48xl") // 0.20
pricing.GetEC2HourlyRate("us-east-1", "c9g.metal-48xl") // 0.20
pricing.GetEC2HourlyRate("us-east-1", "hpc7g.16xlarge") // 3.20Call sites still on the guess table
libs v0.43.3, spawn main:
| Call site | Surface | In #533's table? |
|---|---|---|
cmd/launch_single.go:298 |
--estimate-only: "On-demand:" and "TTL cost:" |
yes |
cmd/service.go:196 |
spawn service: "Rate:" and "Max cost:" |
yes |
pkg/cost/cost.go:257 |
spawn cost compute cost |
yes |
libs/pricing/estimator.go:67 (EstimateSweepCost) |
sweep --estimate-only per-row estimate — cmd/launch_sweep.go:854, :939 |
no |
| ↑ same value | --budget comparison, reportSweepBudget(costEstimate.TotalCost) cmd/launch_sweep.go:862 |
no |
The last one is the one I would prioritise after launch_single.go: --budget is documented
as a warning rather than a cap, but a sweep budget check computed from this table is a warning
that will not warn. On a fleet of metal-48xl rows it under-counts the whole sweep by ~38×.
Suggested fix
The precedent is already in this repo, written out in cmd/slurm.go:46-61: build truffle's
pricer, opt out of the static fallback for a spend-gate figure, and let an unpriceable type
be an error naming the type and region. That comment's reasoning — "it is what a user says yes
to before spawn launches billable instances, and a rate that is merely old is still wrong to
quote as current" — applies verbatim to --estimate-only, which is the say-yes surface.
cmd/launch_single.go:294-310— replacepricing.GetEC2HourlyRatewith the same
truffleawspricer.awsClientis already in scope, so it is roughly the two lines of
cmd/slurm.go:46+:60. Print thePriceSourcealongside the rate; truffle already returns
it, and an estimate that does not say whether it was quoted or guessed cannot be audited.- Same for
cmd/service.go:196, where the label isMax cost:— a word that reads as a
bound, not a guess. libs/pricing.GetEC2HourlyRatecannot say "I don't know", and that is the root defect.
Give it an(float64, error)or(float64, bool)form. As written, its
pricing data unavailablecaller branch (launch_single.go:299) is unreachable: a type
with no.gets0.10(ec2.go:185-187), and an unknown region silently substitutes
us-east-1's table (ec2.go:166-169). The one branch that would tell the truth is dead
because the fallback guarantees a plausible number.- Do not fix this by adding
c8g/c9g/metal-48xlto the tables. That is the treadmill
--cost-limit is enforced against a fabricated rate: an $8 cap on g6e.xlarge does not fire until $74 #533 already declined to get on — the same table was found missing g6/g6e/p5/p5e/c7g/c8g
nine months of instance launches ago, and the fix was to stop consulting it. Adding six
keys buys a quiet year and then mis-pricesc10gthe same way. - Regression test:
GetEC2HourlyRate(or its successor) must not return a number for a
type it does not know.pricing/pricing_test.go:66-71and:131-135currently assert
unknown.xlarge → 0.2as intended behaviour, which locks in the exact value this issue is
about;:141-145locks in the size default;:146-150'sc5.metalcase is the one metal
spelling that works; and:60-65locks in the silent unknown-region substitution. A case for
c8g.metal-48xlwould have caught this before a human read $4.00 and reached for
--cost-limit.
Refs #533 (enforcement half; this is the display half it deferred),
spore-host/truffle#114 (same defect, same resolution: a missing rate is an error, not a guess).
Found while costing phase P2 of scttfrdmn/graviton-blas-bench, whose standing orders require
a cost estimate in the tracking issue before any instance is launched. The estimate that
policy depends on was 38× low.
Activity
scttfrdmn commentedon Aug 20, 2026
Two more absent size keys, and they are not metal:
96xlarge(90× under) and32xlarge(32× under)Second campaign, different project (
scttfrdmn/keel, x86 AVX-512 BLAS), same estimator. Sixtypes priced through
spawn launch --estimate-onlyagainsttruffle find --show-price,us-east-1Linux on-demand,spawn 0.101.0, 2026-08-20:--estimate-onlyc8i.96xlargec6i.32xlargec8a.48xlargec7a.48xlargec5.24xlargec7i.48xlargeThis issue's "New thing 2" reads as a metal-spelling defect. It is not.
c8i.96xlargeandc6i.32xlargeare ordinaryNxlargespellings on current-generation x86.sizeMultiplierhasno
96xlargeand no32xlargekey, so both takemultiplier = 2.0. Adding the Graviton metalspellings would leave both of these exactly as wrong as they are now.
90.0× is the largest error measured on this issue so far (against 38.3× and 41.7×), and it
is not a corner:
c8i.96xlargeat $17.99/hr is the most expensive host in the campaign, so theworst-quoted type is the one whose quote matters most.
c6i.32xlargeisolatessizeMultiplierwith no contamination frombasePriceLargeEvery case on this issue so far mixes both defaults, which is what the "two defaults partially
cancel" note is about. This one does not:
basePriceLarge["c6i"]sizeMultiplier["32xlarge"]So the 32× is the size default alone, measured with the base term held right by the table
itself.
c8i.96xlargedecomposes as base 0.10 (default) vs 0.09371 — 1.07× over — against asize term 96× under, netting 90×.
The spot-check hazard is worse than "the sign flips by family"
It flips by size token within one vendor's adjacent generations, and one of the pair reads
exact:
c7i.48xlarge→ 0.06% over. Both terms present and right (base 0.0893, multiplier 96.0).This is the most accurate reading anywhere on this issue.
c8i.96xlarge→ 90× under.A user sanity-checking the Intel arm of a fleet on
c7i.48xlargegets an answer correct to fourdecimal places, and concludes the estimator is trustworthy immediately before it under-quotes
c8i.96xlargeby ninety-fold.c5.24xlargereading exactly $4.0800 makes that worse, notbetter.
Regression cases
The suggested test in item 5 is
c8g.metal-48xl. A metal-only case would still pass while96xlargeand32xlargeare broken. Non-metal x86 cases that fail today:Confirming the fix target from the launch side
The proposed fix — route
--estimate-onlythrough the pricer the launch path already uses — isconfirmed by this campaign's own launch log. The same command that estimated
c7a.48xlargeprinted, seconds later:
Exact, sourced, and already labelled with its provenance, in the same process that had just
quoted the guess. Nothing needs to be built for item 1; the call is there.
Commented rather than filed separately: same root cause, same fix, and item 4 rules out the
patch a second issue would invite.
fix: display-side pricing (--estimate-only, service dry-run, cost) no…
fix: display-side pricing (--estimate-only, service dry-run, cost) no…
fix(sweep): price sweep rows through truffle instead of a fabricated …
Withdraw --proximity-from and --cost-tier (#864)
Withdraw --proximity-from and --cost-tier (#864) (#871)