~ knotless Search/
↑↓ move↵ open⇧↵ all results

socialweb.computer/socialweb-computer-kcp

socialweb.computer: a compute market on atproto (kcp)

1 collaborator
0
0

tests: staging may fetch failed gate runs; 0014 judges a refusal by its round

Merged johnandersen777.bsky.social asked to merge into main from socialweb.computer/socialweb-computer-kcp:phase-2
docs/plans/0040-findings.md+30−0
@@ -1848,3 +1848,33 @@ Each: what was seen (with the log), the cause, the fix, its proof.
- STAGING at a4aa6d62: test-1 11/11, test-2 3/3, test-3 16/16, test-4 12 of 13: 0014:concurrent FAIL
(`"st-0014-...-1-0" Held on did:plc:td7hozto6bp5trse4b6obkne, which refused it`, alice2); passed on d6a2b391.
Artifacts kept (12 of runs). Agent `rc-0014c` on the cause.
- 0014:CONCURRENT AT a4aa6d62 (agent rc-0014c): `"st-0014-1795035404-6649-1-0" Held on did:plc:td7hozto6bp5trse4b6obkne,
which refused it` (test-4, alice2, 597 s; the entry's passes are 134 to 143 s, d6a2b391 143 s in the same gate order).
SEEN: the run's dir never reached the artifacts. The staging composition's `logs.fetchRuns` call was refused at tick 607
(21:35:35Z): `test may not call computer.socialweb.test.logs.fetchRuns: no edge, and not in its calls allowlist`
(reading `gateRuns`); a09c3c1d added the call but not the NSID to `tests/modules/staging/module.json` `calls`. The
staging VMs (the bidders' journals, the requester logs, the 0014 readings) were released at 22:05Z, so the refusal
reason, the accept URIs and the round of the refusal are lost. Only the gate log survives (`gate/0014-concurrent.log`:
FROZEN, then the cleanup released all four rentals).
CODE (a4aa6d62): the requester logs `requester_submit_accept_declined`, adds the bidder to `declined`, accepts the next
bid, re-RFPs without the refusers, and when a round gets no bid waits for capacity; `waitForCapacity` then sets
`declined = nil` and the next RFP asks every bidder again (`runner.go` 540-552; the same in AGENTS.md "Bidder capacity"
and runbook 0014's `exhausted` row). So Held on a bidder that refused the rental in an EARLIER round is the design;
the check flagged any refusal by the winner, whatever its round. `requester` and `acc-0014`'s line reading did not
change from d6a2b391 to a4aa6d62 (9c3ba113 touched only the record checks, 0002 and 0006).
LIKELY PATH (not proven, the logs are gone): 597 s is about 450 s over a pass, the length of capacity-wait rounds
(30 s, 1 min, 2 min, 2 min ...). In `concurrent` the four rentals fit the two bidders exactly (fit 2, sized from their
live guests; `preLive` was empty), so a rental refused by both means a bidder counted room held by no guest of this run:
a reservation not backed by a guest (the runbook 0014 pitfall row; 91103758 fixed one such case). A candidate in the
code, unproven: `reserveVerdict` (`internal/market/bidder/vmsize.go`) rewrites `b.reserved[key]` without the `vm` that
`reservedFor` bound, so a second reserve of the same RFP key in the window before the informer sees the new ComputeVM
(`acceptRefused` from a submitAccept retry or copy) keeps a 10 min reservation that `committed` counts beside the live VM.
FIX (test, branch rc-0014c): (a) `staging/module.json` calls lists `computer.socialweb.test.logs.fetchRuns`, so the next
failed staging suite brings its failed entries' run dirs; (b) acc-0014 records each refusal's round (the waiting lines
before it) and fails exactly on what the design forbids: Held on a bidder that refused it in the same round, and, in
`run` and `concurrent` (mode 0, no expected failure: the rentals fit), any rental that waited for capacity, naming its
refusals. This run would still FAIL under (b) (as "waited N rounds"), now pointing at the phantom room, not at the
requester. No product change: the bidder fix waits for the evidence.
PROOF: none yet beyond `cargo wasm` and `cargo check -p swc-test-host`. The next test-4 run proves (a) only on a failure
(a `logs/gate-runs/0014-composition-<ms>/` dir in the artifacts); a re-run of `0014:concurrent` on a held staging
network (docs/ci-debug.md) with the bidders' `bidder_accept_refused_capacity` reasons shows which path it was.
tests/modules/acc-0014/src/lib.rs+15−3
@@ -168,9 +168,18 @@ fn check(s: &mut S, mut h: Handle, shape: &Shape) -> Result<Handle, Handle> {
if !chosen(s).iter().any(|b| b["did"] == w.as_str()) {
p.push(format!("{} Held on {w}, not one of the run's bidders", r["name"]));
}
let waits = r["waits"].as_u64().unwrap_or(0);
if waits > 0 && shape.mode == 0 && shape.fails == 0 {
// the rentals fit the bidders' room (fit each, sized from their live guests): a refusal is a race the next bid
// settles; waiting means every bidder refused it with room left, room held by no guest of this run (a reservation
// not backed by a guest: docs/acceptance/0014 pitfalls)
p.push(format!("{} waited {waits} rounds for capacity though the run's rentals fit the bidders' room ({} each), refusals {}",
r["name"], shape.fit, r["declined"]));
}
for d in r["declined"].as_array().into_iter().flatten() {
if d["bidder"] == w.as_str() {
p.push(format!("{} Held on {w}, which refused it", r["name"]));
// a refuser is excluded until the next waiting round, whose RFP asks every bidder again (runner.go waitForCapacity)
if d["bidder"] == w.as_str() && d["round"].as_u64().unwrap_or(0) == waits {
p.push(format!("{} Held on {w}, which refused it in the same round ({} waiting rounds, refusals {})", r["name"], waits, r["declined"]));
}
if d["status"] != 409 || d["body"]["error"] != "CapacityExceeded" {
p.push(format!("{} declined {} {}: not a 409 CapacityExceeded", r["name"], d["status"], d["body"]));
@@ -415,7 +424,10 @@ fn drive(run: Run<Value>, shape: Shape) -> Result<Handle, String> {
}
match data["msg"].as_str().unwrap_or_default() {
"requester_submit_accept_declined" => {
let d = json!({ "bidder": data["bidder"], "accept": data["accept"], "status": data["status"], "body": data["body"] });
// its round: the waiting lines before it (both requester_* lines of the core log, in order); a waiting
// round clears the requester's refusers (runner.go waitForCapacity: the next RFP asks every bidder)
let d = json!({ "bidder": data["bidder"], "accept": data["accept"], "status": data["status"], "body": data["body"],
"round": r["waits"].as_u64().unwrap_or(0) });
r["declined"].as_array_mut().map(|a| a.push(d));
}
"requester_accept_declined_replace" => r["replaced"] = json!(r["replaced"].as_u64().unwrap_or(0) + 1),
tests/modules/staging/module.json+1−0
@@ -101,6 +101,7 @@
"computer.socialweb.test.requester.start",
"computer.socialweb.test.staging.pki",
"computer.socialweb.test.requester.ssh",
"computer.socialweb.test.logs.fetchRuns",
"com.fedfork.exec.kube.get",
"com.fedfork.exec.kube.apply",
"com.fedfork.exec.kube.delete",