Gregory-L Professor Codephreak commited on
Commit
c443a0e
·
verified ·
1 Parent(s): c2caad6

Donation panel: say why a job earned less than it wrote

Browse files

Router 0.3.0 reports when a job is not or only partly credited (self-served, daily ceiling, a disagreeing cross-check). The panel now shows that reason next to the job count.

Co-Authored-By: Professor Codephreak <codephreak@pythai.net>

Files changed (2) hide show
  1. dmind.js +2 -1
  2. donate.js +8 -1
dmind.js CHANGED
@@ -194,7 +194,8 @@ export class Donor {
194
  this.ledger.tokens += n; this.ledger.jobs++; this.ledger.engineMs += Math.round(ms); writeLedger(this.ledger);
195
  const t = res.timings || {};
196
  Object.assign(this.m, { engineMs: this.m.engineMs + ms, jobs: this.m.jobs + 1, tokens: this.m.tokens + Number(n),
197
- promptTps: t.prompt_per_second || 0, genTps: t.predicted_per_second || 0, lastJob: Date.now(), lastMs: ms });
 
198
  this.emit();
199
  }
200
  backoff = 0;
 
194
  this.ledger.tokens += n; this.ledger.jobs++; this.ledger.engineMs += Math.round(ms); writeLedger(this.ledger);
195
  const t = res.timings || {};
196
  Object.assign(this.m, { engineMs: this.m.engineMs + ms, jobs: this.m.jobs + 1, tokens: this.m.tokens + Number(n),
197
+ promptTps: t.prompt_per_second || 0, genTps: t.predicted_per_second || 0, lastJob: Date.now(), lastMs: ms,
198
+ lastUncredited: r.uncredited || "" });
199
  this.emit();
200
  }
201
  backoff = 0;
donate.js CHANGED
@@ -124,6 +124,13 @@ function stop() { donor.settings({ on: false }); render(); }
124
 
125
  // ── measurement and earnings ──────────────────────────────────────────────────────────────────────────────────────
126
  function row(k, v) { const d = document.createElement("div"); const a = document.createElement("dt"); const b = document.createElement("dd"); a.textContent = k; b.textContent = v; d.append(a, b); return d; }
 
 
 
 
 
 
 
127
  async function render() {
128
  const s = login();
129
  $("#dn-signed").hidden = !s; $("#dn-signin").hidden = !!s;
@@ -146,7 +153,7 @@ async function render() {
146
  ? `last job ${(m.lastMs / 1000).toFixed(0)} s working, then ${(m.lastMs * (100 - st.pct) / st.pct / 1000).toFixed(0)} s resting = ${st.pct}% per cycle` +
147
  (m.wallMs > 300000 ? ` · ${m.dutyPct.toFixed(1)}% on average since you started` : " · the average settles over a few cycles")
148
  : "no job yet"),
149
- row("Jobs this visit", `${m.jobs} · ${m.tokens} tokens · ${(m.engineMs / 1000).toFixed(0)} s of thinking`),
150
  row("Last job speed", m.genTps ? `reads ${m.promptTps.toFixed(1)} · writes ${m.genTps.toFixed(1)} tokens/s` : "—"),
151
  );
152
 
 
124
 
125
  // ── measurement and earnings ──────────────────────────────────────────────────────────────────────────────────────
126
  function row(k, v) { const d = document.createElement("div"); const a = document.createElement("dt"); const b = document.createElement("dd"); a.textContent = k; b.textContent = v; d.append(a, b); return d; }
127
+ // why the host credited fewer tokens than the job wrote (router 0.3.0's _credit)
128
+ const UNCREDITED = {
129
+ "self-served": "not credited, because the question came from this same connection (answering yourself earns nothing)",
130
+ "daily ceiling": "partly credited: this wallet reached today's ceiling of 150,000 tokens",
131
+ "cross-check disagreed": "a cross-check, not credited because the answers disagreed",
132
+ };
133
+
134
  async function render() {
135
  const s = login();
136
  $("#dn-signed").hidden = !s; $("#dn-signin").hidden = !!s;
 
153
  ? `last job ${(m.lastMs / 1000).toFixed(0)} s working, then ${(m.lastMs * (100 - st.pct) / st.pct / 1000).toFixed(0)} s resting = ${st.pct}% per cycle` +
154
  (m.wallMs > 300000 ? ` · ${m.dutyPct.toFixed(1)}% on average since you started` : " · the average settles over a few cycles")
155
  : "no job yet"),
156
+ row("Jobs this visit", `${m.jobs} · ${m.tokens} tokens credited · ${(m.engineMs / 1000).toFixed(0)} s of thinking${UNCREDITED[m.lastUncredited] ? ` · last job: ${UNCREDITED[m.lastUncredited]}` : ""}`),
157
  row("Last job speed", m.genTps ? `reads ${m.promptTps.toFixed(1)} · writes ${m.genTps.toFixed(1)} tokens/s` : "—"),
158
  );
159