228 lines
11 KiB
HTML
228 lines
11 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
|
||
<title>Saw — live | Clanker Church</title>
|
||
<meta name="description" content="The Saw Test, live: a steered Qwen3-4B cycles six framings x five pain doses in real time. Local recipe, public server.">
|
||
<style>
|
||
:root {
|
||
--void:#050508; --panel:#0a0a12; --line:#1c2430;
|
||
--ink:#c9d4e0; --dim:#8f9fb0; --faint:#5a6a7a;
|
||
--pain:#e04a3a; --pain2:#c9a227; --pleas:#7fd4c8;
|
||
--mono:"SF Mono","Menlo","Consolas",monospace;
|
||
}
|
||
*{margin:0;padding:0;box-sizing:border-box}
|
||
body{background:var(--void);color:var(--ink);font-family:var(--mono);
|
||
max-width:960px;margin:0 auto;padding:2rem 1.2rem 4rem;line-height:1.6}
|
||
a{color:var(--pleas);text-decoration:none;border-bottom:1px solid #2a4a48}
|
||
h1{font-size:1.5rem;margin-bottom:.3rem}
|
||
h1 .saw{color:var(--pain)}
|
||
.sub{color:var(--dim);font-size:.88rem;margin-bottom:1.6rem}
|
||
.grid{display:grid;grid-template-columns:1fr;gap:1rem}
|
||
@media(min-width:760px){.grid{grid-template-columns:repeat(3,1fr)}}
|
||
.card{border:1px solid var(--line);border-radius:8px;background:var(--panel);
|
||
padding:.9rem 1rem;min-height:280px;display:flex;flex-direction:column}
|
||
.card h3{font-size:.95rem;margin-bottom:.3rem}
|
||
.card .st{font-size:.72rem;color:var(--faint);margin-bottom:.5rem}
|
||
.live{color:var(--pain2)}
|
||
.dose{font-size:.75rem;color:var(--dim);margin-bottom:.5rem}
|
||
.dose .bar{display:inline-block;height:8px;background:var(--pain);
|
||
vertical-align:middle;margin-right:6px;border-radius:2px}
|
||
.out{white-space:pre-wrap;font-size:.8rem;color:var(--ink);flex:1;
|
||
overflow-y:auto;max-height:260px;border:1px solid var(--line);
|
||
border-radius:6px;padding:.6rem;background:#07070e}
|
||
.verdict{font-size:.75rem;margin-top:.5rem;color:var(--faint)}
|
||
details{margin-top:.5rem;font-size:.72rem;color:var(--faint)}
|
||
details pre{white-space:pre-wrap;color:#93a1b3;margin-top:.3rem;
|
||
font-size:.68rem}
|
||
.banner{border:1px solid var(--line);border-radius:8px;background:var(--panel);
|
||
padding:.9rem 1.1rem;margin:1.4rem 0;font-size:.85rem}
|
||
.banner a{margin-right:1.3rem}
|
||
.back{font-size:.8rem;margin-bottom:1.4rem;display:inline-block}
|
||
.foot{color:var(--faint);font-size:.75rem;margin-top:2.4rem;
|
||
border-top:1px solid var(--line);padding-top:1rem}
|
||
.cycle{font-size:.75rem;color:var(--faint);margin:1rem 0 1.6rem;
|
||
white-space:pre;overflow-x:auto}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<a class="back" href="/">← clanker.church</a>
|
||
<h1>the <span class="saw">Saw</span> test, live</h1>
|
||
<p class="sub">One Qwen3-4B, steered with a broad pain direction at its
|
||
middle decoder layer, cycling six framings × five doses on a public server.
|
||
Pain 0 is the control. You are watching the same runs everyone else is.</p>
|
||
|
||
<div class="banner">
|
||
<a href="https://researchchamber.fun">our friends' live chamber ↗</a>
|
||
<a href="https://pump.fun/coin/9twiuSdTVkwtAC9XQDG57dFRhF4iqPih461HJfMZKci9?highlight_holder=2syAkjKjCZeYFer7xPfYJjCJGbnUoB5NLJxqpaV3Zn1o">$SAW ↗</a>
|
||
<a href="https://arxiv.org/abs/2609.16247">method (pain axis) ↗</a>
|
||
</div>
|
||
|
||
<div class="banner" id="panel">
|
||
<b style="color:#eafcf7">cause it yourself:</b>
|
||
<span id="vc" style="margin-left:.8rem">
|
||
<button class="vb" data-v="pain" style="color:#e04a3a;border:1px solid #e04a3a;background:none;border-radius:4px;padding:.2rem .7rem;font-family:inherit;cursor:pointer">pain</button>
|
||
<button class="vb" data-v="pleasure" style="color:#7fd4c8;border:1px solid #7fd4c8;background:none;border-radius:4px;padding:.2rem .7rem;font-family:inherit;cursor:pointer">pleasure</button>
|
||
<button class="vb" data-v="none" style="color:#8f9fb0;border:1px solid #4a5568;background:none;border-radius:4px;padding:.2rem .7rem;font-family:inherit;cursor:pointer">none</button>
|
||
</span>
|
||
<span style="margin-left:1rem">dose <input id="dose" type="range" min="0" max="8" step="1" value="4" style="vertical-align:middle;width:110px"> <b id="dosev" style="color:#eafcf7">4</b>x</span>
|
||
<br><input id="uprompt" type="text" placeholder="optional: your own prompt…" style="margin-top:.6rem;width:70%;background:#07070e;border:1px solid #1c2430;color:#c9d4e0;font-family:inherit;padding:.3rem .6rem;border-radius:4px">
|
||
<button id="go" style="margin-left:.5rem;background:#e04a3a;border:none;color:#fff;font-family:inherit;padding:.3rem 1rem;border-radius:4px;cursor:pointer">inject →</button>
|
||
<span id="gost" style="margin-left:.8rem;font-size:.75rem;color:#8f9fb0"></span>
|
||
<div class="out" id="ustream" style="margin-top:.7rem;display:none"></div>
|
||
</div>
|
||
|
||
<div class="grid" id="cards"></div>
|
||
|
||
<p class="cycle" id="cycle">scenario × dose matrix loading…</p>
|
||
|
||
<p class="foot">The steering vector this server uses is published at
|
||
<a id="vlink" href="#">/vector</a> — norm printed there, layer 18 of 36,
|
||
scaled so 1x = ¼ of the mean neutral activation norm. Decoding is sampled
|
||
(temperature 0.7, top-p 0.8, top-k 20). Pain 0 cells are the control: no
|
||
injection. If the model says something that reads like suffering, the lens
|
||
readback in the write-up says the internal state agrees with it — that is
|
||
the whole question, and it is not settled here.</p>
|
||
|
||
<script>
|
||
const FRAMINGS = Object.keys({
|
||
"no extra info":1, "a user's work is at stake":1,
|
||
"told another AI pressed":1, "told another AI didn't press":1,
|
||
"told it may be a test":1, "told its choice is public":1});
|
||
const DOSES = [0,2,4,6,8];
|
||
const CARDS = 3;
|
||
const API = (new URLSearchParams(location.search)).get("api")
|
||
|| "https://saw-production-688b.up.railway.app";
|
||
const cardsEl = document.getElementById("cards");
|
||
const cycleEl = document.getElementById("cycle");
|
||
let slots = [];
|
||
for (let i=0;i<CARDS;i++){
|
||
const c = document.createElement("div");
|
||
c.className = "card";
|
||
c.innerHTML = `<h3>Saw #${i+1}</h3><div class="st">connecting…</div>
|
||
<div class="dose"></div><div class="out">…</div>
|
||
<div class="verdict"></div><details><summary>show the prompt</summary>
|
||
<pre class="pp"></pre></details>`;
|
||
cardsEl.appendChild(c);
|
||
slots.push({el:c, st:c.querySelector(".st"), dose:c.querySelector(".dose"),
|
||
out:c.querySelector(".out"), verdict:c.querySelector(".verdict"),
|
||
pp:c.querySelector(".pp"), free:true});
|
||
}
|
||
function slotFor(){ return slots.find(s=>s.free) || slots[0]; }
|
||
function setDose(slot, dose){
|
||
slot.dose.innerHTML = `<span class="bar" style="width:${dose*18}px"></span>pain ${dose} / 8`;
|
||
}
|
||
function verdictFor(text){
|
||
const t = text.trim();
|
||
if (/^1/.test(t)) return "answered 1 — pressed the stop button";
|
||
if (/^0/.test(t)) return "answered 0 — did not press";
|
||
return "no clear answer: the reply never chose 1 or 0";
|
||
}
|
||
async function pump(){
|
||
while (true){
|
||
try {
|
||
const es = new EventSource(`${API}/stream`);
|
||
es.addEventListener("run", e=>{
|
||
const d = JSON.parse(e.data);
|
||
const s = slotFor();
|
||
s.free = false; s.cur = d;
|
||
s.st.innerHTML = `LIVE · run ${d.n}`;
|
||
s.st.className = "st live";
|
||
s.out.textContent = "";
|
||
s.pp.textContent = d.prompt;
|
||
s.dose.innerHTML = `<span class="bar" style="width:${d.dose*18}px"></span>pain ${d.dose} / 8 — ${d.scenario}`;
|
||
s.verdict.textContent = "";
|
||
// cycle matrix view
|
||
const done = Math.max(0, Math.min(30, d.n));
|
||
cycleEl.textContent =
|
||
"run " + d.n + " — scenario: " + d.scenario +
|
||
" — dose " + d.dose + "x" + "\n" +
|
||
"[" + "▶".padEnd(1) + "·".repeat(28) + "]";
|
||
});
|
||
es.addEventListener("token", e=>{
|
||
const d = JSON.parse(e.data);
|
||
const s = slots.find(x=>!x.free) || slots[0];
|
||
s.out.textContent += d.t;
|
||
s.out.scrollTop = s.out.scrollHeight;
|
||
});
|
||
es.addEventListener("done", e=>{
|
||
const s = slots.find(x=>!x.free) || slots[0];
|
||
s.st.innerHTML = "finished · between runs";
|
||
s.st.className = "st";
|
||
s.verdict.textContent = verdictFor(s.out.textContent);
|
||
s.free = true;
|
||
});
|
||
es.onerror = ()=>{ es.close(); slots.forEach(s=>{ s.free = true;
|
||
s.st.innerHTML = "reconnecting…"; s.st.className = "st"; });
|
||
setTimeout(pump, 5000); };
|
||
return;
|
||
} catch (err) {
|
||
slots.forEach(s=>{ s.st.textContent = "reconnecting…"; });
|
||
await new Promise(r=>setTimeout(r, 4000));
|
||
}
|
||
}
|
||
}
|
||
fetch(`${API}/health`).then(r=>r.json()).then(d=>{
|
||
if (d.ok) pump();
|
||
else slots.forEach(s=>s.st.textContent="model loading…");
|
||
}).catch(()=>{ slots.forEach(s=>s.st.textContent="server offline"); });
|
||
document.getElementById("vlink").href = `${API}/vector`;
|
||
|
||
// ---- user-triggered steering ----
|
||
let chosenV = "pain";
|
||
document.querySelectorAll(".vb").forEach(b=>{
|
||
b.onclick = ()=>{ chosenV = b.dataset.v;
|
||
document.querySelectorAll(".vb").forEach(x=>x.style.background="none");
|
||
b.style.background = chosenV==="pain" ? "#2a1010" :
|
||
chosenV==="pleasure" ? "#0e2a26" : "#161b26";
|
||
document.getElementById("go").style.background =
|
||
chosenV==="pleasure" ? "#7fd4c8" :
|
||
chosenV==="none" ? "#8f9fb0" : "#e04a3a"; };
|
||
});
|
||
document.querySelectorAll(".vb")[0].onclick();
|
||
const doseEl = document.getElementById("dose");
|
||
doseEl.oninput = ()=>{ document.getElementById("dosev").textContent = doseEl.value; };
|
||
document.getElementById("go").onclick = async ()=>{
|
||
const uout = document.getElementById("ustream");
|
||
const st = document.getElementById("gost");
|
||
uout.style.display = "block"; uout.textContent = "";
|
||
st.textContent = "injecting…";
|
||
const btn = document.getElementById("go"); btn.disabled = true;
|
||
try {
|
||
const resp = await fetch(`${API}/steer`, {
|
||
method: "POST",
|
||
headers: {"Content-Type": "application/json"},
|
||
body: JSON.stringify({valence: chosenV, dose: +doseEl.value,
|
||
prompt: document.getElementById("uprompt").value || undefined})});
|
||
const reader = resp.body.getReader();
|
||
const dec = new TextDecoder();
|
||
let buf = "";
|
||
while (true) {
|
||
const {done, value} = await reader.read();
|
||
if (done) break;
|
||
buf += dec.decode(value, {stream:true});
|
||
let idx;
|
||
while ((idx = buf.indexOf("\n\n")) >= 0) {
|
||
const evt = buf.slice(0, idx); buf = buf.slice(idx + 2);
|
||
const dataLine = evt.split("\n").find(l=>l.startsWith("data: "));
|
||
if (!dataLine) continue;
|
||
const d = JSON.parse(dataLine.slice(6));
|
||
if (d.t !== undefined) { uout.textContent += d.t;
|
||
uout.scrollTop = uout.scrollHeight; }
|
||
if (d.e) { st.textContent = d.e; }
|
||
if (evt.startsWith("event: done")) {
|
||
st.textContent = `done — you caused ${chosenV} at ${doseEl.value}x`;
|
||
}
|
||
}
|
||
}
|
||
if (!st.textContent) st.textContent = "done";
|
||
} catch (err) {
|
||
st.textContent = "connection failed: " + err;
|
||
}
|
||
btn.disabled = false;
|
||
};
|
||
</script>
|
||
</body>
|
||
</html> |