The Black on the page: a first-attempt range marked low evidence; the Black panels load again
CI / test (pull_request) Successful in 40s
CI / test (pull_request) Successful in 40s
- The odds card for the Black: "Low evidence", "about 1 in N" first attempts, the 95% range written as "between 1 in X and 1 in Y", later attempts effectively never, why it is uncertain (every logged shadow is a rider who chose to post), and the steps (shadow -> reached the Black -> bonded). Dashed border. - Valley map: the Black's routes are solved for a first attempt (they showed ~0% per attempt), labelled "on a first attempt", and "Why this route?" gives the same range and caveat. - "The Black is not dice" panel: why the odds are uncertain, and what replaces the assumption (fresh-account bot runs to the tree). - analysis/black/evidence.py wrote "odds_ratio": Infinity (no later-attempt shadow at all), which is not JSON: the page's two Black panels showed "could not be loaded". Now null, and the report says "unbounded". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
@@ -92,7 +92,8 @@
|
||||
const model = () => st.policy.samples[st.sample];
|
||||
function advisorFor(enc, colour = st.colour) {
|
||||
const k = `${st.sample}|${colour}|${st.objective}|${enc}`;
|
||||
if (!st.cache.has(k)) st.cache.set(k, S.advisor(model(), colour, st.objective, { only: [enc] }));
|
||||
// the Black needs the shadow, which (almost) only shows on a first attempt: its routes are solved for that attempt
|
||||
if (!st.cache.has(k)) st.cache.set(k, S.advisor(model(), colour, st.objective, { only: [enc], attempt: colour === "Black" ? "First attempt" : null }));
|
||||
return st.cache.get(k);
|
||||
}
|
||||
let encParams = null;
|
||||
@@ -530,7 +531,7 @@
|
||||
});
|
||||
// destination label
|
||||
const end = pts[pts.length - 1];
|
||||
pill(gLab, end.P.x, end.P.y + 30, `${pct(r.value.x)} per attempt`, { edge: tc, strong: rel === 1 });
|
||||
pill(gLab, end.P.x, end.P.y + 30, `${pct(r.value.x)} ${st.colour === "Black" ? "on a first attempt" : "per attempt"}`, { edge: tc, strong: rel === 1 });
|
||||
// choice points on the focused route: one diamond per place, even when several choices are made there
|
||||
// (at the bully fight: help or walk away, your first move, the dagger, then the bullies' fate)
|
||||
if (focus) {
|
||||
@@ -841,7 +842,7 @@
|
||||
|
||||
function panelRoutes(routes) {
|
||||
const best = Math.max(1e-12, ...routes.map((r) => r.value.x));
|
||||
const T = model().targets[st.colour], b = T[st.objective];
|
||||
const T = model().targets[st.colour], first = st.colour === "Black" && T.firstAttempt, b = first ? T.firstAttempt.thisAttempt : T[st.objective];
|
||||
const focus = routes.find((r) => r.enc === st.focus) || routes[0];
|
||||
const card = (r) => {
|
||||
const rel = r.value.x / best, o = encOutcome(r.enc), c = encColour(r.enc);
|
||||
@@ -851,7 +852,7 @@
|
||||
return `<button type="button" class="ex-route-card${r.enc === focus.enc ? " on" : ""}" data-enc="${r.enc}" aria-pressed="${r.enc === focus.enc}">
|
||||
<i class="ex-swatch ${style}" style="--c: var(${DV[st.colour]}); opacity:${(0.3 + 0.7 * rel).toFixed(2)}"></i>
|
||||
<span class="nm">${esc(ENC_NAME[r.enc])}${RESCUE[st.colour] === r.enc && st.colour !== "Green" ? " <em>(rescue)</em>" : ""}</span>
|
||||
<b>${pct(r.value.x)}</b><small>per attempt · ${bond}${n < 30 ? ` · only ${n} attempts logged` : ""}${r.value.o > 0.005 ? ` · ends on another dragon ${pct(r.value.o)}` : ""}</small></button>`;
|
||||
<b>${pct(r.value.x)}</b><small>${st.colour === "Black" ? "on a first attempt" : "per attempt"} · ${bond}${n < 30 ? ` · only ${n} attempts logged` : ""}${r.value.o > 0.005 ? ` · ends on another dragon ${pct(r.value.o)}` : ""}</small></button>`;
|
||||
};
|
||||
const steps = focus.steps.filter((s) => s.kind === "decision" || s.kind === "chance").map((s) => {
|
||||
if (s.kind === "chance") return `<li class="chance"><span>${esc(s.label)}</span><b>${esc(String(s.taken))}</b><small>roll ${pct(s.probs[s.taken])}</small></li>`;
|
||||
@@ -862,7 +863,7 @@
|
||||
return `<li class="dec${open ? " open" : ""}"><button type="button" class="ex-step" data-var="${s.var}" aria-expanded="${open}"><span>${esc(s.label)}</span><b>${esc(String(s.taken))}</b><small>${s.userSet ? "your choice" : "best"} · ${s.var === "encounter" ? pct(s.options[s.taken].pX) : pct(s.options[s.taken].pX)}</small></button>${opts}${inside}</li>`;
|
||||
}).join("");
|
||||
const risks = focus.steps.filter((s) => s.risk && s.risk.p > 0.0005).map((s) => `${s.risk.label.toLowerCase()} ${pct(s.risk.p)}`);
|
||||
const lb = st.policy.samples.lowBias.targets[st.colour].thisAttempt;
|
||||
const lbT = st.policy.samples.lowBias.targets[st.colour], lb = first && lbT.firstAttempt ? lbT.firstAttempt.thisAttempt : lbT.thisAttempt;
|
||||
return `<div class="ex-head" style="--c: var(${DV[st.colour]})">${mini(st.colour, POSE_OF[st.colour])}<div><span class="eyebrow">Routes to a</span><h2 id="h-valley">${st.colour} dragon</h2></div>
|
||||
<button type="button" class="ex-close" id="ex-clear" aria-label="Back to the whole valley">×</button></div>
|
||||
${chooser()}
|
||||
@@ -874,7 +875,7 @@
|
||||
<ol class="ex-steps">${steps}</ol>
|
||||
<p class="small muted">Diamonds on the map are choices: click one to see where the other options lead. ${st.blocked ? "" : `Your choices apply to every route to this dragon. Changed your mind? <button type="button" class="linklike" id="ex-reset-route">Reset your choices</button>`}</p>
|
||||
<details class="ex-why"><summary>Why this route?</summary>
|
||||
<p class="small">Best route for any ${st.colour}: <b>${pct(b.pX.mean)}</b> per attempt (95% interval ${pct(b.pX.lo)}–${pct(b.pX.hi)}), about ${isFinite(b.expectedAttempts.mean) ? Math.round(b.expectedAttempts.mean) : "–"} attempts. Riders who logged every run suggest ${pct(lb.pX.mean)}.</p>
|
||||
${first ? `<p class="small"><span class="pill warn">Low evidence</span> Best route for the Black, on a <b>first attempt</b>: about <b>1 in ${Math.round(1 / Math.max(b.pX.mean, 1e-9))}</b>, somewhere between 1 in ${Math.round(1 / Math.max(b.pX.hi, 1e-9))} and 1 in ${Math.round(1 / Math.max(b.pX.lo, 1e-9))} (95%). Later attempts almost never see the shadow. The low-bias sample suggests about 1 in ${Math.round(1 / Math.max(lb.pX.mean, 1e-9))}. Every logged shadow comes from riders who chose to post their run, so the shadow's odds rest on an assumption until complete first-attempt logs exist.</p>` : `<p class="small">Best route for any ${st.colour}: <b>${pct(b.pX.mean)}</b> per attempt (95% interval ${pct(b.pX.lo)}–${pct(b.pX.hi)}), about ${isFinite(b.expectedAttempts.mean) ? Math.round(b.expectedAttempts.mean) : "–"} attempts. Riders who logged every run suggest ${pct(lb.pX.mean)}.</p>`}
|
||||
<p class="small">Each roll's odds may depend on your earlier choices, as far as the data support it. Choices marked "no clear winner" in <a href="#deep">Deep Dive</a> are within the noise.${risks.length ? ` Risks on this route: ${risks.join(", ")}.` : ""}</p>
|
||||
<p class="small">The bond chance at each encounter is the community average: the form does not record the answers riders gave there.</p>
|
||||
<div class="seg" role="group" aria-label="Data"><button type="button" data-s="all" aria-pressed="${st.sample === "all"}">All runs</button><button type="button" data-s="lowBias" aria-pressed="${st.sample === "lowBias"}">Low-bias</button></div>
|
||||
|
||||
Reference in New Issue
Block a user