Commit Graph
404 Commits
Author SHA1 Message Date
keptn42 7169c9da0a libref: swiglu_step, router_sigmoid_group_topk and mla_attn_paged
Three ops Ling-3.0 needs, with their references, OPS.md entries and ref_test cases.
swiglu_step is the SwiGLU clipped after the SiLU, as vLLM and SGLang serve Ling-3.0.
router_sigmoid_group_topk is noaux_tc routing with groups: a group ranks by the sum of its two best
biased scores and only the best groups' experts are candidates. mla_attn_paged is dense causal
latent attention over a paged cache whose row is the latent then the rotated key part, with an
optional head-wise sigmoid gate; it refuses zero rows and reads a gate row at the gate's own pitch.
2026-11-03 19:07:34 +01:00
keptn42 9c5d4a656c tokenizer: possessive quantifiers where the greedy reading matches the same
A possessive repetition of one class at the top level, whose tail in its concatenation is classes
that share no codepoint with it, gives the same matches read as greedy: a shorter run leaves the
tail facing a codepoint it cannot take. Ling-3.0's pre-tokeniser pattern has two such quantifiers.
Everything else stays refused by name.
2026-11-03 19:07:34 +01:00
Constantin 798fb21e51 prefill: key tape splits from ordered host KV bounds 2026-11-03 19:05:30 +01:00
Constantin aa14eea76c prefill: fail closed when live split geometry is unknown
Head-256 split-prefill launchers now declare that their grid depends on
live KV. Without an architecture geometry key, those passes stay live
instead of replaying a stale tape. Qwen keys only a proven one-sequence
prefill. Plugin ABI 34.
2026-11-03 19:05:30 +01:00
Constantin ded64c0bd3 prefill: key recordings by live split geometry 2026-11-03 19:05:30 +01:00
Constantin 9cb04f62a8 config: --gpu-memory-mib, the inverse of --gpu-headroom-mib
N claims that many MiB of every card; headroom is the rest. The two
flags cannot be combined. vLLM's utilisation fraction, written in MiB.
2026-11-03 19:02:52 +01:00
Memoria (Noblistic) aa182fc156 docs+tests: drop the page-wide separator claim, close one surviving mutant
Review B of 54d4613 refuted the second clause of the separator sentence. The
population is 15 dots / 46 pipes, not the 11/15 enumerated before it: the history
line's own anchor dot is written as the escape form, so a glyph grep misses the
sentence's own subject. And triple()/acceptTriple() pipe-separate an extreme from
a window mean from a current value in the strip tiles, which is a plain field
join only by stretch. The clause corrected one overclaim by asserting its
negation; the real state is asymmetric, so only the line-local scoping stays.

history.test.js:
- add tpsF(9.994) == "9.99", which kills the sig3 9.995->9.994 mutant that
  survived 09ac548. Measured: FAIL got "10.0" want "9.99", rc=1.
- the reviewer's other proposed closer, tpsF(99.951) == "100", is NOT added.
  Against the tps 99.95->99.951 mutant it passes, and 2000 samples across
  [99.94, 99.96) give shipped and mutant the same output set ["99.9","100"]:
  cnt and sig3 agree throughout [99.95, 99.951). That mutant is behaviourally
  equivalent and no literal can catch it, so the check would be a guard that
  cannot fail.
- the n=25 floor/ceil check could never fail (mkRows is strictly increasing), so
  it is now a fixture precondition that throws instead of a counted check.

Check count stays 63. Suites after: 27/35/63/34 JS, dashboard_test 241 over 8.
No shipped code touched.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) d564e6e5b1 tests/js: break the tautology the delta review caught, and three surviving mutants
The delta review refuted guard 3 of 4dce97b, and it was right. Replacing the re-typed formatters
with a slice of the shipped ones removed one unfalsifiable shape and installed another: tpsF/cnt3F/
durF are called on BOTH sides of every comparison, so any formatter bug cancels out. Verified with
my own instrument before fixing -- shipped `tps = (v) => "X"` passed all 37 checks. The brief
warned about exactly this and I walked into it anyway.

Three sections added, each mutation-tested with rc captured on its own line:

Formatter literals (14 checks). The only place the formatters are pinned to something other than
themselves. tps -> "X" now fails 5 checks; the dur ms branch -> *100 + " s" fails 2. Band
boundaries are pinned at both edges (9.995 inclusive, 99.95 exclusive) because that is the rule F1
of the docs fix depends on. Values were derived from the shipped source rather than copied from
the review's draft, which caught a real error in it: DASH is U+2013, not a hyphen, so the drafted
`tpsF(NaN) === "-"` would have failed on correct code.

Median at an ODD row count (2 checks). M17 survived the previous fixture change because the median
was only ever asserted at n=24, where floor(12) and ceil(12) are the same row -- a non-uniform
fixture could never have caught it, so the earlier diagnosis named the right cause and the wrong
cure. n=25 makes the two candidates differ, and floor->ceil now fails with "1.80 s" want "1.70 s".

Threshold counts adjacent to the boundaries (8 cases, up from 3). M15 survived because no case sat
at 19, and a >=5 -> >=7 mutation survived because no case sat below 7. Counts now straddle both
thresholds: 4/5/6 pin the 5 boundary, 19/20 pin the 20.

history.test.js 37 -> 63 checks. Full suite: 27/35/63/34 JS, 241/8 and 62646/184 C++.

GAP D (the revoke delay argument) deliberately not pinned: the 1000 ms is a safety margin, not a
contract, and a guard that fails a reasonable 500 ms encodes an arbitrary constant.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (xhigh) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) 8be040f599 tests/js: five guards that could not fail, now proven to fail
The review ran 27 mutants and 6 survived. Each fix below was then mutation-tested against the
shipped source, with rc captured on its own line -- a piped `| tail` reports the tail's status and
would have hidden every one of these.

download.test.js 31 -> 34 checks:

The assertion at :64 could not fail. `ok(page.indexOf('<span class="cap">Requests</span>') < iBtn)`
compares against indexOf, which returns -1 when the caption is absent, and -1 < anything is always
true. Renaming the caption survived both suites. Now the index is captured and required to exist
before the order is compared.

The stubs recorded counts, not sequence: click() incremented a counter, appendChild pushed to a
separate array. So click-before-appendChild survived -- and Firefox ignores a click on an anchor
that is not yet in the DOM, so that ordering is a silently dead button in a real browser. One
shared seq[] log now makes the order assertable, and the mutant is caught by the new assertion
itself ("the anchor is in the DOM BEFORE it is clicked: ["click","append","remove"]"), not by a
crash. My first attempt at that mutant targeted el.body, which does not exist, and failed with a
TypeError -- proving only that the mutant was malformed, so I rebuilt it against the real line.

history.test.js 29 -> 37 checks:

The formatters were re-typed. The suite passed its own `(v) => v + " ms"` into the shipped
renderer, then asserted "value and unit are one string" against the unit the stub had
manufactured -- testing the fake, not the page. tps/cnt3/dur are now sliced from the shipped
source (DASH..dur is self-contained) and the guard compares against what the real dur() renders.

Presence assertions became value assertions. "last 20" appearing in the string survived
slice(-20) -> slice(-100), because the label was still there while the figure silently became the
last 100 -- a wrong number on a performance dashboard. Each figure is now compared to a mean
computed independently of the shipped group(). The fixture also had to change: the old cycling
values made mean(all) equal mean(last 20) by coincidence, so no window mutation could show up in
the output. Distinct values per row fix that.

Threshold fixtures at 7, 12 and 24 rows. 12 is the discriminating count -- it kills a threshold
lowered to <=12 as well as one raised.

The two .hsep padding regexes are unified. One was loose, one strict, and they disagreed about
whitespace: a reformat from `padding:0 9px` to `padding: 0 9px` passed the loose test and then
CRASHED the suite on `null[1]`. One regex, one match, checked before use.

Verified: slice(-100) caught (2 failures), threshold >=12 caught, ttft median->mean caught
("1.65 s" want "1.70 s"), padding reformat now passes cleanly. Full suite: 27/35/37/34 JS,
241/8 and 62646/184 C++.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (xhigh) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) 08fa89255c GUIDE: seven doc claims the review found false, plus the comment that caused the worst one
The adversarial review's call was ship the code, fix the docs first. Every correction below was
re-verified against the shipped code before editing, not applied on the verdict's word -- the
review ran against e9f0622 and the tree is now rebased a559977, so all anchors were re-located by
content.

The blocking pair:

F2 was the worst: "Reloading the page resets these figures, a server restart does not" states the
opposite of the code. newEngineRun() deletes extAt/extAtS (dashboard.cpp:1735-1736), poll() calls
it when started_at changes (:3942), and this branch's own extremes.test.js:103 is titled "a
RESTART drops the extremes". Three independent instruments, one doc line saying the reverse. The
error was inherited from a stale comment at :1709-1710, so that comment is corrected too -- it is
the root cause, and it is comment-only: every changed line in dashboard.cpp starts with an
asterisk, verified by filtering the diff.

F1 is a worked example a reader copies: sig3 renders one decimal across [9.995, 99.95), so the
line prints "best 58.0 | recent 54.0", not "best 58 | recent 54".

The rest are one-liners: F3 claimed three categories carry windows when ttft is a median with
none (:2282); F4's rationale for the window rule fails at its own boundary -- at exactly 20 rows
last-20 repeats the overall mean, which is now stated rather than papered over; F5 put the poll
summary under the fields when #advsum sits in the panel header (:1404); F6 said figures hold
while reading another page without the 60 s limit that drops the windows (GAP_S = HIST_S = 60);
F7 showed a middle dot where :2530 ships a pipe. README:19 credited poll_spark.test.js with
poll()'s restart decision -- that file contains zero matches for poll(); the coverage is in
extremes.test.js.

The numbers the brief flagged as suspect (HMAX=200, RECENT_S=15, RECENT_PREFILL_S=5) were correct
and are untouched. The real errors were prose semantics and rendered formatting, which the
flagging did not anticipate.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (xhigh) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) 599d904e01 tests/js: README lists all four suites and the render check
The README still named only the two suites that came out of the 2011-01 review; history.test.js
and download.test.js shipped without a line, and render_align.js shipped without its invocation
or its puppeteer prerequisite. A reviewer opening tests/js/ could not tell what to run or what
each one guards.

The render check gets its own section because it is not a unit test and cannot be: it needs
Chrome, and it exists because three visual claims on this branch were made from the CSS and the
SVG viewBox and all three were wrong. That is the argument for measuring the rendered page, and
it belongs next to the tool that does it.

Docs only, no code touched.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) 51db1729b1 dashboard: level the download glyph with the caption, measured not reasoned
The operator's intent, drawn rather than described: the bottom of the tray bar should sit on
the same line as the bottom of the letters in REQUESTS. The previous commit claimed the
viewBox-flush geometry achieved that. It did not.

Headless Chrome, screenshotting the real header at 4x and finding the lowest inked pixel row of
each: the caption's letters ended at device row 71 and the tray bar at 63 -- the icon floated
2.00 CSS px high. align-items:baseline puts the SVG's BOX on the text baseline, and the baseline
sits above the box bottom, so filling the box was necessary but nowhere near sufficient. A 2px
translateY on the glyph closes it; re-measured, both bottoms land on device row 63, gap 0.00.

tests/js/render_align.js is that measurement, kept in the repo so the claim can be re-checked
rather than trusted. It is manual and not wired into CMake -- it needs puppeteer and a Chrome
binary, which are not repo dependencies -- and exits nonzero when the two bottoms differ. It
fails on the pre-fix page (2.00px above, rc=1), which is the only reason to believe it.

download.test.js's guard was the thing that gave false confidence here: it asserted the glyph
"sits on the baseline" from the viewBox arithmetic alone, and passed while the icon floated. It
now pins both halves -- the glyph fills its box AND the 2px nudge is present -- and the comment
records that the earlier claim was wrong and why the test could not see it.

A unit test cannot catch either of this session's two visual errors: the collapsed whitespace
(zero width, not the 13px claimed) and this float. Neither is a property of the string the code
builds. Both are properties of the rendered page, and only the rendered page was checked here.

Suites: download 31, history 29, extremes 27, poll_spark 35, dashboard_test 241 over 8 cases,
sched_test 62646 over 184, no failures. Alignment mutations caught: removing the nudge, making
it 1px, re-insetting the bar in its box.

Not deployed. Goes to review with the separator and export commits.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) d537dc09aa dashboard: sit the download glyph on the baseline instead of floating above it
The icon looked awkward next to REQUESTS: it floated a hair above the caps. The header aligns
its items on the text baseline, and an inline SVG's baseline is its box bottom, so the box
bottom was on the baseline -- but the tray bar was drawn at y 13.5 of a 16-unit viewBox,
leaving 1.7 units of empty space below it. The visible bar therefore sat above the baseline
while the letters sat on it.

Redrawn so the bar's stroke bottom lands exactly on the viewBox bottom (centreline 15.2 plus
half the 1.6 stroke = 16.0), which puts the bar on the baseline with no offset to tune. The
shaft and arrowhead moved up by the same amount to keep the proportions.

download.test.js gained a geometry guard that parses the viewBox, stroke width and bar
centreline out of the shipped markup and asserts the stroke bottom is flush with the box
bottom. Re-insetting the bar to the original 13.5 fails it with the measurement (14.3 want 16),
so a future edit that reintroduces the float is caught rather than eyeballed.

Verified: download 29 checks, history 29, extremes 27, poll_spark 35, dashboard_test 241 over
8 cases, sched_test 62646 over 184, no failures.

Not deployed. Goes to review with the separator and export commits.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) c36d04d99c dashboard: move the JSON export to the Requests header as a download icon
The history summary row had grown crowded -- the figures, then a "json" button and a "clear"
button -- and the operator asked for the export to live in the Requests panel header instead,
top-left by the title, as a download icon with a "Download JSON file" tooltip. The Requests
header already carries running/waiting on the right, so the export sits opposite it on the
left rather than lumped in with the history figures.

The button is an inline SVG download glyph (a <button>, so it is keyboard-focusable and
announced), in a new .pleft group so the space-between header keeps it on the left with the
title. The handler now saves a file rather than copying to the clipboard: a Blob of the stored
rows, an anchor with a download name, clicked and removed, the object URL revoked after the
click. The old #hjson clipboard button is gone.

This also fixes a clipping bug the previous commit introduced. Making each category a nowrap
span and the separator a padded element removed every whitespace text node between categories,
so the summary line became one unbreakable run: a long line overflowed the row and clipped the
buttons after it -- the "json" the operator saw cut off at the panel edge. A zero-width space
between groups restores a break opportunity: the line can now wrap between categories, while
each category still stays atomic. The break point sits between groups, never inside one, where
nowrap would make it inert.

tests/js/download.test.js, 27 checks, drives the shipped handler against stubs: the button is
in the Requests header on the left of the aside, exactly one of them (a duplicate id would bind
only the first and leave a dead control), tooltip and aria-label present, an icon not a text
label; the handler builds one anchor, names it radiance-history.json, types the blob
application/json, clicks it, attaches it to the document (Firefox needs that), removes it, and
revokes the object URL only after the click. The payload round-trips through JSON.parse.

history.test.js gained the break-point checks: three zero-width spaces between four categories,
each immediately before its group, none buried inside a nowrap group.

Verified by mutation: dropping the download attribute, never clicking, never revoking, a wrong
blob type, changed tooltip text, and moving the button to the right of the aside each fail the
suite. extremes 27, poll_spark 35, history 29, download 27, dashboard_test 241 over 8 cases,
sched_test 62646 over 184, no failures.

Not deployed. Goes to review with the separator commits.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) 1554b451e1 dashboard: a history category wraps whole, and its break is a padded element
The summary line wrapped mid-figure: "ttft median 810" ended one line and "ms" started the
next. A category that cannot fit should move to the next line intact, not break wherever the
browser finds a space.

Each category becomes one span with white-space:nowrap, so it is atomic, and the dot between
categories becomes a padded element carried INSIDE the group it introduces -- as a sibling it
could be left stranded at the end of a line when the group wrapped, which is the same orphan
in a different place.

This also corrects a false premise in the two commits before it. HTML collapses runs of
whitespace, and .hsum sets no white-space, so the "wide" double-spaced separator those commits
introduced never rendered wide: it collapsed to a single space exactly like the tight one. The
spacing change was not subtle, it was zero -- which is why it looked identical. Width has to
come from a padded element, not from spaces in the string. The pipe-within-category and
dot-between-categories distinction is unaffected by this and stands.

tests/js/history.test.js, 24 checks, drives the shipped assembly against a DOM stub and reads
the shipped CSS: every category is a nowrap .hgrp, the break is a padded .hsep, the dot is the
first child of its own group rather than a sibling, a category's own figures carry pipes and no
dot, and the ttft category is a single text node so value and unit cannot split.

Verified by mutation: dropping nowrap, dropping the padding, moving the dot to a sibling,
turning the category break into a pipe, and splitting the value from its unit each fail the
suite -- the last being the exact 810 / ms orphan this fixes. extremes 27, poll_spark 35,
dashboard_test 241 over 8 cases, sched_test 62646 over 184, no failures.

Not deployed. Goes to review with the separator commits.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) 757ad11b0d dashboard: separate distinct fields with pipes, not middle dots
Every line that packs several distinct figures into one string used the middle dot, at two
weights -- a tight dot between sub-figures and a wide one between groups. At 11px the dot is
too short to read as a boundary, so lines like the history summary ran together: count, three
tok/s figures, three prefill figures and ttft all sat at one visual level. The operator's call
was to use the pipe wherever fields are meant to be distinct.

Fifty-eight separators converted across the page -- the history summary, the version line, the
KV and expert asides, the acceptance and step-time detail lines, the graph and model-view
metadata, the control-vector summary, the poll summary. The two weights are kept: a tight dot
becomes a tight pipe, a wide dot a wide pipe, so the group-versus-window hierarchy the wide
dot carried survives the glyph change.

Two dots stay, because they are not field separators: the CSS list-bullet marker
(.gmeta li::before content) and the browser tab title (file - radiance). The range dash in
"layers 1-8" and the DASH placeholder are likewise untouched. The two " + " the earlier
census turned up are inside pctn building "<0.1" and ">99.9" string literals, not separators.

The sweep missed eight separators at first: the age clause and several detail lines build
their separator as the escape "\u00b7" rather than a literal dot, and a literal replace
never sees those. Caught because the tests that pin the age clause went red on the literal
sites but the escaped ones did not -- a partial conversion that would have shipped a page
with pipes and dots mixed. Both forms are now converted.

Tests: the two regexes pinning the age clause and the one string pinning the poll summary
now expect the pipe. They failed when the code changed and pass now, which is the point --
a separator assertion that could not fail would not have caught the escaped-dot miss.
extremes.test.js 27, poll_spark.test.js 35, dashboard_test 241 over 8 cases, sched_test
62646 over 184, no failures.

GUIDE's two example triple lines, which mirror the page's separators, updated to match.

Verified the sweep by reading all 58 changed lines, not by trusting the count: no pipe landed
inside a regex literal (where it would mean alternation) or a prose tooltip. Both hazard
greps were positive-controlled against known-bad input before their empty result was trusted.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) 0ac154c803 dashboard: drop the uptime comparison -- it could only fire on a clock step
8ee893e added `up < lastUp` beside the started_at comparison, to catch a restart landing in
the same whole second as the one the page last read. It cannot catch that. uptime_s is
derived, not independent: unix_now() - started_at_, both whole seconds, so started_at +
uptime_s is exactly the wall clock at every poll. Two processes sharing a started_at are
therefore read at increasing wall times and report INCREASING uptimes, so the comparison
never fires in the case it was written for. It fires on genuine restarts, which started_at
already catches, and on a backward NTP step, which is not a restart at all. Net effect: dead
where it was needed, redundant elsewhere, and a false clear of the session extremes on every
clock correction.

The test that "proved" it worked was fed an impossible fixture: started_at 100 with uptime 40
implies the clock read 140, then started_at 100 with uptime 2 implies 102. Time running
backwards is the only way to reach that pair, which is the same mistake the finding it
answered was about -- reasoning from a state the instrument cannot produce. It now asserts
the reachable behaviour instead: a backward uptime with an unchanged started_at is a clock
step and must NOT clear the extremes, since they still belong to the running process.

The collision the comparison tried to close needs a replacement process stamped in the same
second as the one the page last read. The page can only learn started_at once /stats answers,
startup_s after the old process began -- 69 s on this engine -- so a replacement starting
after its predecessor stopped answering is stamped a later second. The bound is startup_s >=
1 s; a model that came up inside a second could collide, and would cost one stale extreme
carrying a true age. That is documented where the comparison used to be.

The acceptance window's use of the same signal is NOT redundant and is untouched: it has no
started_at comparison, so for a tab that stopped polling while a new process drafted past the
old totals, a falling uptime is the only thing that catches the restart.

Verified: dashboard_test 241 checks over 8 cases, extremes.test.js 27, poll_spark.test.js 35,
sched_test 62646 over 184, no failures. Mutation re-run after the revert: deleting poll()'s
detection line, stamping extAtS on every sample, and deadening acceptTriple's age clause each
fail the suite. Behavior is unchanged from the deployed build, which never had the
comparison, so no restart is needed for this.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) 638aa3a683 tests/js: drive poll()'s restart decision, and the two clauses nothing reached
An adversarial pass mutated this leg of the dashboard and found three mutants that survived
every committed check. All three were real gaps in my verification, and the reason was the
same each time: the tests called the helper directly, so the code that DECIDES whether to call
it was never exercised, and two clauses sat behind a guard that no test ever opened.

Drive poll() itself. A scripted /stats sequence and a fixed clock, with resetWindows,
newEngineRun and update replaced by counters, so the assertions are about what poll() decided
rather than what the helper does once called. Three cases: the first poll is a baseline and
clears nothing, a changed started_at clears, and a long quiet span takes the gap path without
being read as a restart -- the distinction the previous commit exists to make.

Re-sample a key after its extreme is set. The stamp records when the extreme was set, so a
worse sample must not refresh it; nothing used to sample the same key twice, so moving the
stamp to every sample -- which makes every age read about zero, wrong output rather than
missing output -- passed unnoticed.

Exercise acceptTriple with a live extreme. Its only previous call came from the restart case,
which clears extAt first, so it returned at its guard before reaching the age clause: the
clause was asserted zero times while triple's was asserted seven.

Use the shipped pctn rather than a re-typed one. The copy diverged from the real formatter for
small and non-finite values; nothing asserted on that output today, so it was a latent trap
rather than a live error. Pass the sampled value as a parameter instead of interpolating it
into the function source, so the null case is a real null and not the string "null".

Verified by mutation, which is the only thing that makes a green suite mean anything here:
disabling poll()'s detection line fails the suite, as does moving the stamp to every sample,
as does deadening acceptTriple's clause, as does removing the uptime comparison added in the
previous commit. extremes.test.js 27 checks, poll_spark.test.js 35, dashboard_test 241 over 8
cases, sched_test 62646 over 184, no failures.

Found by an adversarial review pass on the author's own commits.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) 08c85ea527 tests: run the dashboard page's JavaScript, in the tree
An independent review of 9cc237f rejected its verification claim: the commit said 18 checks
executed the shipped noteSample, triple, acceptTriple, resetWindows and newEngineRun, and the
tree contained none of them. The harness was real and passing, but it lived in /tmp, so nobody
else could re-run it and the claim was unfalsifiable from the repository. That is a fair
rejection regardless of whether the checks were right -- a verification nobody can repeat is a
claim about the author's machine.

Move both harnesses into tests/js/ and add the extractor they need. The page is one C++ raw
string, so a JS test has to pull the script out of the translation unit it ships in; page.js
does that, and each test slices the functions it exercises by line range and CALLS them. Both
details matter: a retyped copy tests the copy, and a sliced function that is defined but never
invoked passes without testing anything, which has already happened once in this code.

extremes.test.js, 17 checks: the age clause appears only when an extreme stands alone and is at
least a second old, tracks the newest extreme rather than the first, survives a gap with its age,
and is gone after a restart along with the extreme itself.

poll_spark.test.js, 35 checks: the clamp's floor, ceiling and fallbacks, the in-flight trigger,
the old storage key migrating to a flat rate, corrupt storage falling back, the summary label
matching what is set, the sparkline's x axis being time-proportional rather than sample index,
the right-edge fill at startup, a sample gap drawn as a gap in the line, and the prune loop
keeping samples by elapsed time rather than by count. The window expectations derive from the
shipped HIST_S, so changing the constant moves them instead of silently passing.

Verified: both pass, and both fail when the code is wrong -- setting the age gate to zero fails
extremes.test.js, and returning the sparkline to index spacing fails four checks in
poll_spark.test.js. dashboard.cpp is unchanged by this commit and dashboard_test still reports
241 checks over 8 cases.

Not wired into ctest: they need node, which is not a build dependency here and will not be on a
contributor's box or in the ROCm build image. Making a missing optional tool a red build is worse
than an opt-in test, so the README says how to run them and when to bother.

Found by an independent review pass on the author's own commits.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) 4e35a00493 sched_test: assert the slot reuse the recycled-slot case depends on
The case that guards the admitted_us reset read two timing inequalities and never checked
that the second request landed in the first request's slot. It rests on that: if the reap
defers, or the free list is pre-populated, the second request gets a fresh struct, the stale
stamp is absent by construction, and the invariant holds with the bug unpatched. A test whose
precondition is a property of the fixture rather than an assertion goes quiet without saying
so, which is worse than not having it.

Read the slot from the published row before the reap and assert it afterwards. This also
settles the one thing the review could not: whether the reap releases immediately or defers.
It releases, because the assertion holds -- proven by running it rather than by reading the
ahead-step planning that decides it.

Verified: the case passes, and removing the reset line still fails it, so the added assertion
did not blunt it. sched_test 62646 checks over 184 cases, no failures.

Found by an independent review pass on the fix itself.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Memoria (Noblistic) e53286cdbe dashboard: the history figures mean what their labels say
Five changes to one leg, committed together because they are one claim: a number on the
dashboard should be readable as the thing it is named for. They were deployed as
1.15.1-histfix without being committed, so the running engine carried code no commit
described, and a review of the working tree could not see its own context.

History labels. "avg" becomes "mean", the window figures appear only once enough rows
exist to be the window they name, ttft says median, and every history column carries a
title= spelling out what it averages and over what. A legend that has to be inferred
from a column header gets inferred wrong.

The prefill instrument. The history computed prefill speed as prompt tokens over
time-to-first-token, which charges queue wait to prefill; GUIDE:2808 warns against
exactly that formula. The scheduler now stamps admission and reports prefill_s, so the
column measures admission to first token. The page falls back to ttft when an engine
reports no admission time, so it still works against a stock build.

Windows in seconds. Every displayed window was a sample count, so "60s" meant 60 samples
and its span drifted with the poll rate: 60s at 500 ms, 6s at 100 ms. The rings now prune
by accumulated time and the sparkline's x axis is time-proportional rather than sample
index, so a busy stretch gets the room its seconds deserve and a gap in the samples shows
as a gap in the line. This is the precondition for the interval control below; at a fixed
rate the two agree, so a full ring draws exactly as before.

The interval control. An Advanced view with two editable fields, idle and busy, held in
localStorage: the cadence belongs to whoever is reading, not to what is serving, and the
server has no writable config that would survive an image swap. Both are plain numbers
rather than a mode switch, because the point is that the reader sets the rate; equal
values are one fixed rate and the summary says so.

Wind-down. The tile detail lines now sample on every poll, so "recent" follows the
engine's own idle decay instead of holding the last figure it saw, and a window older than
its own span is cleared rather than drawn as if continuous.

Fixes from an independent review on qwen, which found the first two:

admitted_us was never reset when a slot was recycled. add_locked only allocates when the
slot's pointer is null, so the struct survives release_locked with every field it does not
list intact, and the first-admission guard then kept the previous request's stamp. The
interval spans two requests, the stale stamp is always older, so prefill tok/s reads low
rather than missing. It reaches every row once the slot pool turns over. It feeds only
this one dashboard column: the engine-wide prefill tile uses an independent windowed
counter, and no admission, eviction, preemption or KV path reads the field.

Two tooltips still said prefill includes queue wait after the instrument stopped charging
it. Both now say what the code does and disclose the fallback, since one window can mix
rows measured from admission with rows fallen back to ttft.

Verified: both targets build clean. dashboard_test 241 checks over 8 cases, sched_test
62644 over 184, no failures. The new sched_test case drives submit, finish, reap and a
second submit onto the recycled slot and asserts prefill_s never exceeds ttft_s, since
admission cannot precede arrival; it fails against the bug and passes after the fix, so it
can fail. The embedded page parses under node --check, and 30 checks now execute the
shipped spark(), the clamp and the cadence trigger sliced out of the page rather than
restated: time-proportional spacing, the right-edge fill at startup, a sample gap drawn as
a line gap, the 100 ms floor, and the old storage key migrating to a flat rate. Not
tested: the controls' behavior in a real browser, and how the session extreme should read
when it outlives a cleared window.

Found in review by an independent qwen workstream; the slot-reuse finding was confirmed
by a second adversarial pass and against the source independently.

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
2026-11-03 18:09:49 +01:00
Deadcode 769b4c64a6 radiance 1.16.0
New models:
- Hunyuan3D-2 (hunyuan3d2): an untextured 3-D mesh from one picture of an object. DINOv2-giant
  over the picture, a FLUX-shaped flow-matching DiT (16 double-stream and 32 single-stream blocks
  of 1024) over 3072 latents with both guidance branches in one step, and the shape VAE's
  geometry decoder. Converted from tencent/Hunyuan3D-2's hunyuan3d-dit-v2-0 folder with
  data/recipes/hunyuan3d-2-bf16.recipe (fp16 cast to bf16, 4.4 GiB, one card). The licence
  (Tencent Hunyuan 3D 2.0 Community License) does not cover the EU, the UK or South Korea
- Served on Hunyuan3D-2's own API server routes, so its Blender add-on and scripts work
  unchanged: POST /generate answers with the mesh, POST /send runs it in the background and
  GET /status/{uid} reports steps_done and then the file. GLB, OBJ, PLY or STL; the field is
  sampled coarse to fine as FlashVDM's hierarchical decoding does, or densely with
  "volume_decoding": "dense"; seed, steps, guidance and octree_resolution as the reference.
  Texturing (Hunyuan3D-Paint) is refused for now (docs/GUIDE.md §5.17)

Merged:
- libr3d rewritten for RDNA3's wave matrix (@RikshaDriver): bf16, f16, int8-activation and vocab
  GEMMs retiled to 16x128 blocks with a double-buffered k-walk; fp8, mxfp4a8, w2a8, w4a16, w5a16
  and w8a8 quantised GEMMs and the gated form; grouped MoE GEMMs (bf16, fp8a8f32, mxfp4a8); the
  norms and quantisers, the QSA state ops and the MoE router, scatter and gather. Brought onto the
  op contract before release (13 schemas, the MoE GEMMs on weight tables with a_order and bf16
  output, moe_gather's gate pitch, moe_scatter above 1024 slots, the mxfp4 m16 dispatch) and its
  gated-delta-net kernels replaced by libhalo's; every op it serves now passes rad-kbench against
  libref on a gfx1151, and r3d_selftest checks its MoE GEMMs by value
- Gemma 4 31B: asymmetric int5 linears (w5a8i8 above 64 rows, w5a16 up to 64, a scale per 128),
  the norm, GELU and two-rank all-reduce junctions at quant_act_i8g's grid (rmsnorm_quant_i8g,
  gelu_mul_quant_i8g, ar_rmsnorm_quant_i8g) so the prefill overlap runs on the i8a8, a4 and w5
  trunks, and compose files for the 31B i8g, heretic-ara-i8g and w5 on two cards (@keptn42)
- The norms' lane sum reads eight at a time: TranslateGemma 27B decode is back from 225 to 239
  tok/s a stream at four streams, bit for bit the same output (@mici81)
- The head-256 prefill softmax rescales each row by its own maximum, not by a vote of the wave, so
  a row's rounding no longer depends on which rows share its launch (@gostar)

Anthropic Messages API:
- /v1/messages takes min_p, presence_penalty, frequency_penalty, repetition_penalty and
  repeat_last_n as top-level fields with the chat path's names, ranges and meaning, so clients that
  speak only the Anthropic format (Claude Code) can set a model card's sampling, such as Qwen's
  presence_penalty 1.5. The penalties count the last repeat_last_n tokens of prompt and reply (64
  by default, --repeat-last-n), as llama.cpp does

Plugin ABI 33:
- Shape generators: rad_declare_shape_generator, RadShapeGenBatch (RadBatch::sgen_b) and
  RadArchProbe::gen_shape, with the SCOND, SSTEP, SLATENT and SQUERY passes. The layout
  fingerprint table is regenerated; out-of-tree plugins rebuild against 33
- New op point_fourier ([x | sin(x 2^j) | cos(x 2^j)], times pi on request) in libref, libavx,
  libr4d and libhalo
- A checkpoint for a model that reads no text gets a one-token vocabulary

More cards from the one image:
- stilldeadcode/radiance now carries libr3d (RDNA3: gfx11-generic, every gfx11 chip) and libhalo
  (Strix Halo: gfx1151, preferred there over libr3d) beside libr4d (gfx1201). docker/build.sh and
  the Dockerfile default to gfx1201;gfx11-generic;gfx1151
- libr3d loads only where the KFD topology lists a gfx11 card and libhalo only where it lists a
  gfx1151; a process without /dev/kfd sees neither. On an RDNA4 card, or with no card at all,
  the image therefore behaves exactly as before, and rad-convert lays weights out as before
- libhalo and libr3d now declare gemm_nt_q's w_rb, and libhalo gram_accum's upper, as libr4d
  does. Before, any build carrying them refused both at load ("9 parameters vs 8"), so a build
  for Strix Halo or RDNA3 had no device kernel library
- libhalo does not yet have every op libr4d added after it was ported (the IQR rows, Pixtral and
  Ministral rope, the tree-attention and DFlash-tree rows, among others); halo_parity lists them
  and is left out of the image's test stage until they are ported

Fixed -- container and checkpoint parsing:
- A .rad expert-1 entry inside or before expert 0 is refused; a vocab section whose count names
  an array at offset 0 is refused rather than read from the file header; offset checks no longer
  wrap; header tables must sit on their element alignment
- An imatrix array of arrays (unbounded recursion) and a safetensors header naming a tensor twice
  are refused; a failed RadWriter undo says the container is damaged; a tune cache measured on
  another machine is refused, as its format contract says

Fixed -- plugins:
- Two plugins declaring one op with different parameter roles are refused; before, the core
  applied the first one's chunk/capacity roles to the other's rows
- Null tables behind nonzero counts, unknown roles, keyless parameters or constraints and more
  operands than an issue carries are refused by name at load; on the host backend device rows are
  dropped even when no fat binary was registered; rad-schemas checks the ABI layout fingerprint as
  the engine does

Fixed -- device:
- Stream slots are recycled under a new generation: before, 1024 stream create/destroy cycles
  (LoRA loads, lanes, uplinks) made every later rad_stream_create fail
- A stream whose drain fails keeps its queue and kernarg ring instead of freeing them under the
  card; the kernarg ring no longer leaks when its access grant fails; a block over 1024 work-items
  is refused
- rad_dev_free takes the allocation off the ledger the pin-cap check reads; the host backend
  charges pages to the card the range was reserved for

Fixed -- engine and server:
- Two NDEBUG-only asserts (runtime-window totals, ring blocks per group) are refusals; a
  plugin-declared lcm past int64 saturates so the quantum check refuses it; every share view rect
  and part span is bounded by its entry
- Video: the timestep regions hold the refine rungs a schedule appends, a zero-frame encode is
  refused, /v1/videos bounds each side before the area product, and a realtime session needs a
  clip length to cut a turn at

Fixed -- kernels and quantisation:
- A trellis run shorter than a state's codes (tcq_rows=1, or N % tcq_rows == 1) read its seam
  out of bounds; the encoder now refuses it as the decoder does, and tcq_rows below one state is
  refused at parse
- qsa_tail_store bounds its slot index by the state plane (libr4d and libhalo); paged attention
  refuses kv_heads <= 0; libavx row_amax skips a NaN as libref does

Fixed -- tools:
- pad_tp.py no longer runs cp through a shell with shard names from the checkpoint's index
  (quote injection, path traversal): names must be bare file names
- ops_doc_check.sh runs under mawk (Ubuntu's awk); rad-kbench --max-cases/--max-bytes are checked
  integers; oot_plugins fails unless the installed replay passed a case and failed none

Thanks to @RikshaDriver, @keptn42, @mici81 and @gostar.
2026-11-02 18:35:02 +01:00
keptn42 7892524801 gemma4_bf16: fused junctions and the prefill overlap on the i8a8, a4 and w5 grids
The residual junctions take the `_i8g` twins where the linear after them reads quant_act_i8g's
pair, so the prefill overlap runs on these trunks too. An a4 or w5 linear reads an f16 copy of
its input up to 64 rows: in such a step its junction also writes the bf16 norm output into the
linear's input row, where the unfused norm would, and the cast and w4a16_asym / w5a16 run as
before; the feed-forward keeps gelu_mul there. At four ranks the all-reduce is issued apart.

arch_test: the 31B on the three grids at one, two and four ranks -- the junctions, the decode
band's bf16 row, the same GEMMs and casts as the unfused step, the slices against the whole
step, codes and scales of every int8 pair on the same rows -- and the E4B form.
2026-11-01 21:00:22 +01:00
keptn42 141212dd88 gemma4_bf16: asymmetric int5 linears (w5a8i8 and w5a16 over a scale per 128)
a4 at five bits: u5 codes, a u8 zero point (0..31) and an f16 scale per [1 x 128] (libquant
`codes=u5 zero=u8 group=128 scale=f16`), ParoQuant int5's grid with no rotation. Read by w5a8i8
over quant_act_i8g's per-(row, 128) int8 activation above 64 rows and by w5a16 over the input cast
to f16 up to 64, as a4 reads w4a8i8_asym and w4a16_asym; q|k|v stay one GEMM. The views, row parts
and column cuts are a4's.

arch_test: the 31B form on both asymmetric grids at one and two ranks.
2026-11-01 21:00:22 +01:00
fl0l0u b6acbd69e4 server: name the caller a vouched proxy carried, without arming the guard
An operator running radiance behind a reverse proxy sees one address in
every log line: the proxy's. --trusted-proxy CIDR (repeatable) vouches
for the networks whose sockets may say who they carried. An
X-Forwarded-For from inside a vouched network is walked from the right:
vouched hops are skipped, the first address no vouched CIDR covers is
the caller, a chain of only vouched hops ends at its leftmost, and
anything else falls back to the socket. From an unvouched socket the
header names no one, because it has not been vouched for.

Attribution is not authority, and the split that keeps them apart is
mechanical. HttpRequest carries `peer`, the attributed caller, sanitized
where it is built because a named address arrives in a header and the
log keeps no client text otherwise -- and `raw_peer`, the socket as the
kernel saw it, which is now the only address peer_is_loopback() reads.
A proxy on loopback therefore hands the keyless loopback-only routes to
none of its clients; it only names them where the proxy used to stand.
transport_test pins both halves: the walk at the unit level, and over a
real socket that a vouched proxy plus X-Forwarded-For leaves the
loopback guard answering 200 and the cross-origin 403 untouched.

httplib's own set_trusted_proxies -- new this side of the vendor bump --
is deliberately unarmed. It rewrites req.remote_addr, the very field the
guards would read as the socket peer, so one over-broad vouched network
would move the guard rather than the log line. Radiance reads the header
itself, and ip_in_cidr refuses across families: a vouched ::ffff:0:0/96
vouches for no IPv4 socket. Config rejects anything but a numeric
network with a prefix at startup, because a typo there would silently
unvouch a proxy; the refusals the transport answers before the router
log the attributed caller too, so the audit trail stays one line per
request whoever the socket belongs to.
2026-10-31 07:50:43 +01:00
fl0l0u 8e65e1a302 ci+vendor: pin the lifted tree by hash, and run the suite on every push
Two standing gaps in how this tree is guarded.

vendor/ records what every lifted file is and what we changed, in prose
-- prose nothing enforces. vendor/SHA256SUMS is the mechanical half:
all 73 files under vendor/, the lifts, the patch series and the record
itself, hashed; tests/vendor_sums.sh recomputes both directions -- a
file whose content drifted from its record, and a file that arrived
without being recorded -- and fails the suite (ctest: vendor_sums, in
the fast tier). An unrecorded change to a lifted dependency now has to
survive being a committed manifest update to ship, instead of slipping
through a rebase the way 33108e4's silent reverts did through this
branch's history.

And no CI ran the suite at all. .woodpecker.yml (Codeberg CI) builds
CPU-only with the media codecs present and runs the host preset --
everything but the gpu and oot tiers. The runner is the current Ubuntu
LTS deliberately: the mp4 writer binds FFmpeg's >= 7 AVIO callbacks and
24.04's 6.1 does not compile it.

Rehearsed on a native Ubuntu 26.04 box -- the same gcc 15.2 the image
carries -- the host preset fails eight cases on this branch, and the
same eight on plain upstream/main: arch, chatparse, engine_e2e, two
gbnf shards, place, quant_ggml and avx_check. Pre-existing under gcc
15, partly machine-dependent (avx_check compares kernels op by op on
the CPU it finds, and the gbnf shards flip under load); this branch
adds none of them. CI's first red is upstream's to see.
2026-10-31 07:50:43 +01:00
fl0l0u 1577854d00 hfget+deploy: fetch a repo on verified claims, and run with a key argv cannot show
The --model repo-id path trusts the hub with the machine's filesystem and
the container runs with the kernel's door off. Both stop here.

hfget.sh trusted a listing's file names to be names: an absolute path or
a .. segment wrote wherever the destination's owner could write, and a
name shadowing .hfget-manifest taught the next run whatever it liked. A
listing is now vetted whole before anything is fetched -- absolute
paths, .. segments, control characters (a tab splices one entry into two
fields), names of hfget's own manifest -- and a child refuses a path
that would escape anyway. Silent skipping was the alternative, and it
leaves a directory that reads as complete and is not.

And the content key was the hub's claim, never checked: an LFS file was
kept for its size and its claimed oid recorded without ever hashing the
download, so a swapped file of equal length -- or a spliced resume at
any length -- passed forever after. The download is hashed on arrival
and kept only when it matches the claimed sha256; a mismatch deletes the
file, and the manifest now certifies verified content.

--model-revision REV fetches at a branch, tag, sha or refs/pr/N instead
of the moving main: without it a restart can serve weights nobody
reviewed, and the guide now says to name one.

--api-key-env NAME reads the key from the environment, where only the
process and root can reach it, not the command line where every process
on the host reads it in ps; an unset or empty variable refuses startup
exactly like an empty --api-key. The compose files carry the key
through environment: now -- the fail-closed :? guard moves with it --
across all 52 model files.

And the containers' seccomp=unconfined has a way out: Docker's default
profile, plus exactly the calls that forced the escape -- io_uring for
the n-gram table, mbind/set_mempolicy/get_mempolicy for ROCm's NUMA
binding -- is shipped as seccomp-radiance.json and selected through
RADIANCE_SECCOMP; the default stays unconfined until each operator
audits their own card stack. Verified: under the profile io_uring_setup
and set_mempolicy behave as under unconfined and a non-listed syscall
earns EPERM.

hf_model_test: the escape-listing refusal, the oid verify (bad rejected
and deleted, good certified), the pinned revision fetched -- against a
fake curl for a hub. config_test: --api-key-env fails closed unset,
reads the key set. ASan+UBSan: config/diag/hf_model/server/transport/
wire/lifecycle, 8/8.
2026-10-31 07:50:43 +01:00
fl0l0u ad3f03dbc6 server: no internals on the wire, no client text in the log, no paths for strangers
Four ways the server told more about itself than the caller earned.

The exception handler logged e.what() sanitized and then put the raw
string on the wire: a 500 whose message echoes request text is a
reflection point, and one that quotes how a handler broke names the
server's internals to whoever prodded it. The wire gets the generic
sentence now; the reason stays in the log. The realtime and speech
sockets caught their session's exception the same way -- raw what() to
the log and onto the client's error event -- and follow. Their WebSocket
wrapper logged e.what() and the request path unsanitized: the path is
fully client text, and a client that can put CRLF and an escape sequence
into a log line can forge the next one.

A security-relevant header sent twice is a request built to be read two
ways: this server reads the first copy, a proxy in front may read the
last or join them, and whichever copy the disagreement lands on, the
attacker picked it. Host, Authorization, X-Api-Key and Origin are
refused whole at 400 before either reader -- the key gate included --
even when every copy carries a valid key. The lookup is
case-insensitive, so an Authorization beside an authorization counts.

And the model card's `root` is a path on this machine, served to anyone
/v1/models admits. Keyless, it now belongs to the local operator, the
rule /diagnostics and the LoRA admin already follow; with a key it
travels with the key.

server_test: the_models_root_path_follows_the_key. transport_test:
a_duplicated_security_header_is_refused. ASan+UBSan: server/transport/
wire/stream/speech/speech_stream/dashboard, 7/7.
2026-10-31 07:50:43 +01:00
fl0l0u 1c967b2f14 sched+engine: keep a scored request's size from reaching the pinned pool
A scored request asks the engine for the logits of chosen candidate ids
at its prompt's last position (Request::token_scores). Three places
where that readout's memory was someone else's decision:

The candidate list was bounded by value, never by count, and the count
is what a scored step pays for: the step stages the union of every
staged request's candidates as hidden and table rows in one pinned host
buffer, before anything is admitted or accounted. One request naming a
million ids -- any caller of the raw request seam -- is a multi-gigabyte
pinned allocation the box either loses or dies on. add_locked caps the
list at 4096, orders above what a decision request names (its prompt's
written answers, a few dozen), and says so in the refusal.

And when the pinned allocation is lost anyway -- the cap bounds one
request's rows, not the batch's union, and the pool can be low for
reasons of its own -- stage_scored_rows returned E_NOMEM into the step
loop's fail path: the whole engine stopped, every connection with it.
It cancels the scored requests instead, on the step loop's existing
deferred-cancel vector the sampler's grammar failures already use: a
request whose scores the box cannot hold is that request's failure. No
alloc-failure seam exists to test the branch directly; its cancel path
is the sampler stage's, applied at the same join.

And declare_scores now refuses a head table shorter than the
vocabulary: the scored readout indexes it by token id, the scheduler
bounds candidate ids by meta.n_vocab, and a table a few thousand rows
short turns the last block of the vocabulary into a read off the end of
a weight -- a device fault, not a refusal. Padding past the vocabulary
reads fine and stays fine.

sched_test: a_scored_request_names_at_most_the_candidate_cap.
build_test: declare_scores_wants_a_table_that_covers_the_vocabulary.
ASan+UBSan: sched/build/server/systemone/config/diag, 6/6.
2026-10-31 07:50:43 +01:00
fl0l0u 5f7244da4d server: bound what an unauthenticated socket can make the transport hold
Three ways a client spent the server's patience or memory without ever
being admitted:

The gate's 401 answers before any handler sees the request, so its body
sits unread on a keep-alive socket, and httplib's anti-smuggling drain
will wait for it: one byte per read timeout paces a whole worker, at the
pacing client's chosen rate. The refusal now closes the connection
instead, says so on the response, and buries the body with the socket --
which is also what makes draining a refusal pointless.

A drain that does have a purpose -- a framed body on a request the
router answered without reading it -- inherits the stream's 30 s read
wait per packet gap and no total bound at all. It keeps both waits now:
five seconds per gap (the stream's own set_read_timeout, the same knob
the WebSocket upgrade uses) and five in total (a deadline the discard
provider checks), then the connection dies and the timeout is restored
for whatever the connection still has coming.

And bodies. The per-request cap bounds one body and no sum, every byte
of a body is buffered before parse, admission or any accounting sees
it, and a few hundred concurrent large POSTs is an OOM that reaches the
engine before any refusal does. read_and_bridge now holds every buffered
byte against a transport-wide budget and answers 429 with Retry-After to
the newcomer the budget has no room for; the reservation releases on
every exit, including the peer vanishing mid-body. The budget defaults
to eight bodies at the per-request cap and moves through
ServerOptions::max_inflight_body_bytes.

Vendor: the two httplib hunks are recorded as patches/0022, and
UPSTREAM's "no file content differs" for the pair is replaced with what
the split actually is and what is now edited in it.

transport_test: a_refusal_closes_the_connection,
a_stalled_drain_dies_on_its_deadline, the_inflight_body_budget. ASan+UBSan:
transport/wire/lifecycle/server/config/diag/dashboard, 7/7.
2026-10-31 07:50:43 +01:00
fl0l0u ec53bce5dc server: stop treating the loopback socket as identity
Three guards read a loopback peer plus a matching Origin as "this is
the machine's operator". Two real topologies forge exactly that:

DNS rebinding hands a hostile page its victim's own browser, so the
peer IS loopback, and the page is same-origin with the server, so the
Origin/Host compare stays silent. Only the Host still says which name
the client asked for, and the attacker's domain cannot be made to read
as the loopback.

The documented TLS-proxy topology puts every remote client behind a
loopback socket, and a non-browser client sends no Origin at all; the
proxy passes the public Host, which the new check refuses.

Server::local_operator now guards the keyless routes: the socket, the
Origin, and a Host naming the loopback, --allow-host, or a concrete
bind address. GET /admin/control-vector takes the guard POST already
had, placed before the 404-that-means-no-vector so a remote page can
probe neither; keyless DELETE /sessions and /reset_prefix_cache --
which destroy other clients' cached conversations -- answer the
machine only. --allow-host (repeatable) admits names an operator
reaches the box by from the box itself.

A local user at the console stays admitted; nothing about a key-set
server changes. GUIDE 6.6 states the new posture.
2026-10-31 07:50:43 +01:00
fl0l0u d54f3b9e6e server: bound the last unbounded parses of untrusted text
Three ways in, each ending in a parse that bounds neither what it
builds nor how deep it nests:

videos.cpp read its multipart form fields with the raw parser, so a
512 MiB field of brackets died at the tree's teardown; the same file's
JSON path was bounded, so the form path now shares its gate, and a
field over budget or over depth reads as a bad parse (a form test pins
both refusals and a well-formed field).

Anthropic's buffered body parsed the model's tool-call arguments
directly; the streaming path already scans them with json_complete,
whose depth cap keeps a cooperating model from stack-killing the
worker, and the buffered body now passes the same gate, reading too
deep as an empty input.

The image decoders checked the container header's dimensions against
the pixel cap but converted whatever the bitstream actually decoded;
a container whose SPS disagrees with its header slipped through. Both
now re-check the decoded frame, as the video path already does. The
re-check is inside RAD_HAVE_FFMPEG and compiles with every FFmpeg
build; the media-less container proves the two server changes.
2026-10-31 07:50:43 +01:00
fl0l0u 546f0c2047 config: pin the empty --api-key refusal with a test
d773992 restored the refusal 33108e4 had silently taken back, so the
behavior is main's again. What no branch carried was a test. The hunk
was written once, merged, and deleted by a stale rebase with nothing
noticing until an audit read the parser; an empty --api-key value --
a unit file whose $RADIANCE_API_KEY was never set -- must stay a
startup error, so a config_test case says so, and the next silent
overwrite trips a test instead of an audit.
2026-10-31 07:50:43 +01:00
baKon 9560780bfa sched: a preempted prefill reclaims cache and leaked state slots before it waits
The whole-recompute gate refused a preempted request forever when the pool held only cache entries, and an empty running set left a leaked state slot unreclaimed. Reclaim the cache over several rounds, release idle state slots when nothing is running, and admit the overdue waiter if it can ever fit. A prefill is never a victim while a decoder is running; tests cover the deadlock, the leaked slot, and the lost KV sequence.
2026-10-30 21:32:03 -05:00
Deadcode 9ed3ef7a7b radiance 1.15.0
New models and formats:
- IQR for Qwen3.8-27B: weights on the int8 grid under GPTQ, a trellis down each GPTQ column
  (IQR-V2), and IQR-V3, a computed trellis code under one scale a row, kept at its codes' width in
  VRAM and decoded in the GEMM; 15 IQR-V3 recipes from ~2 to ~7 bits a weight
  (data/recipes/q38-27b-*-v3.recipe, docs/IQR.md)
- libhalo: a kernel library for Strix Halo (gfx1151), preferred there over libr3d
- Nemotron 3.5 Embed 1B and 8B (nemotron35_embed): text and image embeddings through a Pixtral
  tower, on the card and on the CPU
- Nemotron 3.5 Rerank 8B
- /v1/systemone: Cloudflare's clef and clef-flash, Convai Innovations' Laya and Mica beside
  LiquidAI d1; scored steps read the candidates' logits from the head table with no lm_head pass
- LFM2's 8-bit trunk: block-fp8 or int8 linears with the fused producers, and the d1-3B recipe
- DeepSeek-V4.1's reply format with DSML tool calls and typed argument tags

Weights on the drive:
- The file tier reads only the experts the pass routes rows to; the draft head's weights stay in
  the host pool
- A hot VRAM cache for routed experts read off the drive, reads deposited straight into free host
  pool slots, and copyless evictions; the file tier's counters are now ssd_*
- GLM-5 Next shards its routed experts by expert, not by width, so they can live on the drive
- The stall watch counts drive reads as progress, and the DMA lane's room check reads the lane's
  own completion fence

Quantisation tooling:
- --calib-corpus, --calib-dir and --calib-layers record each linear's input Hessian; beside
  --kld-record the reference's own run records them
- --kld-top N records a sparse KL reference (the N most likely tokens and the tail's mass)
- GPTQ in a third of the time with the same codes, trellis GPTQ on the card, vector codebooks
  with coordinate descent, and rad-convert --reuse repeated, each container supplying what the
  earlier ones lack

Speculation:
- Prompt lookup alone (--spec-ngram K, --spec-ngram-min/-max): each sequence keeps an index of its
  n-grams, and a proposal is verified only when its measured step cost says it pays;
  --draft-window adaptive follows it

Speed:
- IQR decode: the narrow tile splits K for four times the int8 tile's waves and folds each 128-K
  block once; at 8 tokens down and the output projections run in 0.61-0.82x and 0.70-0.92x FP8's
  time (2-6 bits); IQ6R-S-V3 with its DFlash2 drafter steps in 26.3 ms at TP2, against 29.4 ms
  before and FP8's 27.3
- Qwen MXFP4 feed-forward: the gated fold up to 16 rows, not 8
- libr4d: the gated prefill fold, the short-prompt split row, and the rows forms of rmsnorm and
  rope; KLATE again for the head-256 gqa6 paged prefill; gram_accum on the matrix cores

Features:
- /health, /v1/health and /ping answer 503 with "status": "stuck" once the device has advanced
  nothing for a minute or a queue has faulted, so a supervisor can restart a wedged server (#356)
- --image-gen-max-pixels and --image-gen-max-refs size an image generator's buffers (#344)
- The startup report lists only the options not at their default, with a count; -v lists all
  (#250)
- --preempt-wait-ms bounds how long a preempted prefill waits for its whole-recompute room
- --placement layer_offload spills dense layers so one --max-model-len sequence fits
- Startup refuses amdgpu with CWSR off and says how to fix it;
  --proceed-with-incompatible-configuration starts anyway under an UNSUPPORTED banner

Fixes:
- The n-gram read-ahead hands each row to the reader once and reads only as far ahead as the row
  cache holds, and pauses while decode reads: about one drive read a row instead of two (#355)
- A file-tier window reads each of its runs once, not once a run per run
- The decode split law's verify floor is bounded by the batch's workgroups: max_seqs 256 no longer
  declares 64x the scratch (#342)
- A prefetch DMA list's mark stays out of the signal pool until the engine has read it, and a
  prefill stage copies only the blocks its own tables name (#343)
- The split-KV row sum is read with fetch-inactive (#328)
- LFM2 on the host backend: libref and libavx serve the row-form ops it declares (#348)
- The preempted-prefill gate skips a KV group that holds no blocks (#352)
- Every request entry point bounded, gated and sanitised (JSON depth, invalid UTF-8, control bytes
  in the log, the dashboard's CSP, cross-origin browsers on the loopback-only routes); a prompt id
  outside the vocabulary refused at admission; --api-key "" refused at startup
- The telemetry the HTTP thread reads is atomic
- An RMS norm row no longer depends on how many rows its launch carries; prefill attention's
  rescale is decided by live rows only
- A --kld-record prefill chunk that finishes no sequence gets its logits on a tied-head model
- A kernel's lazily made counter block is zeroed outside the lock other ranks take (a TP2 first-step
  hang)

Changes: Plugin ABI 32. Every plugin exports a layout fingerprint of the ABI structs and the loader
refuses a plugin without it or with another (#302), so out-of-tree plugins must be rebuilt.
Appended: RadBuildCtx calib_* and gen_max_*, RadArchProbe gen_max_*, RadBatch score_only and
plugin_words, RadDeviceProps::unified, RadChatFormat arg_json_value_prefix.
2026-10-30 22:01:01 +01:00
overchop 8da043c246 place: the caching layer -- hot VRAM cache, deposits, copyless relabels
Routing-aware reads leave a routed expert's bytes on the drive when the
pass routes nothing to it, but the reads that DO happen still have two
wasteful fates: they land in a per-pass buffer thrown away at the next
layer, and they cross the link even when the same bytes already sit in a
host pool slot that just went cold. This commit gives both bytes
somewhere to stay.

The hot VRAM cache: a routed expert whose read heat ranks past the
admission bar lands in a shadow slab slot and stays there. The slot is
its address from then on, until heat evicts it -- eviction is a copyless
relabel (back to Tier::SSD, publish null); the container is ground
truth. The planner budgets the shadow slots for it (per-class on_disk
count); the mover admits (Kind::Admit), evicts, and retires the
admissions.

Deposits: a free pool slot takes the O_DIRECT read directly -- the
read's destination IS the slot -- and the unit becomes a pool unit the
GEMM reads zero-copy, with heat promoting it at PCIe speed later. Its
demotion is a copyless drop (the slot still holds the bytes). A full
pool evicts its coldest unrouted unit by relabel, copyless, and the
freed slot feeds the next deposit.

The counters follow the traffic: the file stager's family is renamed
file_* -> ssd_* (ssd_layers, ssd_units, ssd_read_bytes, ssd_preads,
ssd_read_ns, ssd_wait_ns) beside the existing ssd_reads/ssd_bytes, and
the new legs are counted (ssd_staging_bytes, ssd_promotions and
ssd_promoted_bytes, ssd_deposits and ssd_deposit_bytes, pool_evictions).
The dashboard's expert plane gains the matching staging, promotions and
deposits rows, and --weights-disk-tier's help text names the tier.

Measured on GLM-5.3-Flash TP2 (2x Radeon R9700), 250-token essay at
temp 0: 5.49 tok/s at ~104 GiB of SSD reads per run, against main's
2.05 tok/s at ~378 GiB.

Assisted-by: GLM-5.3-Flash
2026-10-30 15:02:09 +01:00
overchop 9647b84ee0 glm5next: expert parallelism -- experts become file-direct
Main's glm5next width-shards the routed experts unconditionally
(GlmTp::expert_width, ff_lo/ff_hi): an expert's stored form is a shard
across ranks, so --weights-disk-tier refuses it and a 151 GiB expert set
cannot leave VRAM at any pool size. The helper's expert-parallel
declaration (expert_base windows, RAD_SHARD_NONE, no ff spans) already
exists upstream -- qwen4exp uses it -- so this retargets glm5next onto it:
each rank owns 288/world whole experts, the routed arm's buffers
full-width (FE), the shared expert still width-sharded, world 1 unchanged,
and a shape probe's rank >= world clamps to rank 0's window.

Fixes the 24.78 GiB "no eligible tier" startup OOM on 2-card hosts; the
world-8 graph pin is re-recorded from the test's own pin: printout.

Assisted-by: GLM-5.3-Flash
2026-10-30 15:02:09 +01:00
Gaspa79 74e7fddd79 nemotron 3.5 rerank 8b implementation 2026-10-30 09:47:42 -03:00
DeadcodeandClaude Opus 5.5 d773992abc [FIX] restore the prompt vocabulary check, the empty --api-key refusal and scored steps' issue-ahead rule
33108e48 (the preempted-prefill gate's wait bound) was cut from an older main and, landing, took
back three changes that had merged before it:

- a28221eb: a prompt id outside the vocabulary is refused at admission (Scheduler::add_locked),
  never staged into a pass where the embedding gather faults the device and stops the engine; and
  its test, a_prompt_names_real_vocabulary_rows.
- b9c685a9: --api-key "" is a startup error, not a server that looks guarded and answers every
  keyless request; and the guide's lines on it and on the loopback-only routes.
- ed1e5caf: a scored row the step in flight finishes gets no step issued ahead; and its two tests,
  the non-scored one with a token left after the step in flight so that a step ahead exists (#349).

The wait bound itself, the lookup index and the rest of 33108e48 are unchanged. sched_test 176,
config_test 62 and server_test 177 cases pass.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qthwau4zwWgAaD8vZrycp1
2026-10-30 12:18:29 +01:00
mici81andClaude Opus 5.5 8df9240d65 sched: the preempted-prefill gate skips a KV group that holds no blocks
Every program carries a sentinel KV group at index 0. KVGeom reads its decl.kind 0 as RAD_KV_FULL
with block size 1, while the manager's plan for it pages nothing and owns no block. The gate
(e668d49) walked every group KVGeom calls paged, so for the sentinel it wanted the whole prompt,
one block a token, out of a pool of none: a preempted request was never readmitted. The bound on
the wait (33108e4) cannot help, since preempting running requests frees nothing in that group.
engine_e2e_test's qwen35_preemption_by_recompute_changes_no_logit hung on it (the KL recording of a
small pool: one preempted document, nothing left running); with the group skipped it passes in
0.9 s. It may also be the live request in #346 that waited 710 s with gen=0.

The gate now skips a group with no blocks (total_blocks 0), as KVManager::ensure skips a group its
plan does not page.

sched_test: a_preempted_prefill_ignores_a_kv_group_that_holds_no_blocks (a group the scheduler sees
as full and the manager as empty; the preempted request stayed Preempted after the pool emptied
before the fix). 173 cases pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:11:13 +01:00
baKon 9cf8d3dad8 arch/common: DeepSeek-V4.1's reply format, DSML tool calls with typed argument tags
The checkpoint's own encoder writes an assistant turn as reasoning followed by a sectioned DSML call block, with each argument tag naming string or JSON. The template analysis cannot state those typed tags, so the format is declared as data and chatparse_test reads it back. Split from #266; no model plugin or kernels.
2026-10-30 10:23:09 +01:00
Gaspa79 94c90b17ad nemotron 3.5 implementation 2026-10-30 10:22:53 +01:00
baKon 33108e488b sched: a bound on the preempted-prefill gate's wait 2026-10-30 10:21:57 +01:00
Brandon Bertelsen ec243c2a7d Merge main into laya-arch-plugin 2026-10-29 13:45:18 -04:00
Code000andPi 8df39472b6 lfm2: the 8-bit trunk -- block-fp8 linears, the fused producers, and the d1-3B recipe
Every linear of the trunk is a LinearFP8, so the container's encoding decides the
GEMM: bf16 stays `gemm_nt` exactly as before, a recipe's block E4M3 is gemm_nt_q at
fp8a8 over an activation quantised once per producer, and int8 is gemm_nt_q at
i8a8. The format is read off layer 0's first linear; a trunk mixing formats is
refused by name. The convolution, the norms and attention stay bf16.

On a block-fp8 trunk the fused producers run: rmsnorm_quant_fp8 with a fold for
each mixer's norm (the previous block's residual add included) and MlpFP8 for the
feed-forward, whose gate|up GEMM applies SiLU(gate) * up and quantises in its
epilogue. The convolution's C * conv(B * x) and the codes its out projection reads
become one gate_quant_fp8 at act none. `gemm_nt_q_gated_wide` puts whole prompts
through the fold instead of falling back to the pair past 64 rows; k and v ask
for `gemm_nt_q_short`; the head norms and rope ask for `rmsnorm_rows` and
`rope_rows`. Each of those is the model's own declaration, so no other
architecture's path moves.

The lm_head is read at its stored codes (bf16, or E4M3/int8 where a recipe made
it so, logits_gemm_fp8/_i8). A tied head also declares the final-normed rows and
the embedding table to the core (rad_declare_scores), so a scored step needs no
head read at all.

data/recipes/d1-3b-fp8.recipe: all 30 layers' linears to E4M3 with a bf16 scale a
128x128 block; the tied head to int8 per row per 128 columns.

Co-Authored-By: Pi <pi@localhost>
2026-10-29 16:23:28 +01:00
Code000andPi ed1e5caf9d core, abi: scored steps -- rad_declare_scores, RadBatch::score_only, and /v1/systemone's model
A scored request (Request::token_scores, what /v1/systemone asks: the raw logits
at a few candidate ids) does not need the half-gigabyte lm_head read the sampler
would consume. A plugin whose head is the bf16 embedding table declares the
final-normed hidden rows and that table (rad_declare_scores); on a step whose
sampled rows are all scored rows and whose program declared both, the core sets
RadBatch::score_only, the plugin issues everything but the head, and the core
reads the hidden rows and the candidates' table rows back and takes the dot
products in f64 on the host. RadBatch gains one trailing int32 (score_only, 360),
which the pass key mixes; an older plugin never sees it set.

The scheduler issues no step ahead of one that brings a scored row to
max_tokens: that forward pass reads nothing and a max_tokens=1 question would
pay a decode step after its prefill. Scored rows only -- every other decode keeps
the step of overlap it had.

/v1/systemone reports which model answered.

Co-Authored-By: Pi <pi@localhost>
2026-10-29 16:23:28 +01:00
fl0l0u b9c685a9c3 server: bound, gate and sanitize every request entry point
Prepared for exposing the dashboard and the API beyond the local machine. Each piece
answers a finding from the review; none changes what a legitimate client sees.

Parsing. Six entry points still called json::parse with no bound on the tree: the two
WebSocket sessions, the image form's loras field, the two re-parses of template kwargs,
the control-vector POST and the lora-admin body. A legal frame or body of brackets alone
built a tree whose teardown recurses once per level -- one worker stack, one process.
They all go through parse_json_bounded now, the body cap's own value and depth limits.
The same reasoning already refused deep bodies on the generation routes; frames and form
fields were the ones that never passed a gate.

Errors. ApiError::dump threw on invalid UTF-8, and URL-decoded params reach messages
without passing a JSON parser: a 404 becomes a 500, or worse a closed connection. The
dumps replace bad bytes instead of dying.

Logs. Session labels and echoed request text reach the log; an embedded newline forged a
line and an escape sequence drove the terminal reading it. log_sanitize filters control
bytes at the entry points -- labels, refusal logs, the exception handler -- while the
three loggers that print multi-line reports deliberately keep their newlines.

The browser. The dashboard page ships a CSP (its script talks only to its own origin)
and X-Frame-Options DENY; every response carries X-Content-Type-Options: nosniff. And
the loopback-only guards -- control-vector default, runtime LoRA, diagnostics -- now
treat a cross-origin browser as the remote client it is: a hostile page reaches them
through the victim's own browser, which is exactly loopback. Origin not matching Host
refuses; same-origin and non-browser traffic are untouched.

The gate. The API key's path exemptions are method-scoped (reads, plus the POST /ping of
the health-check convention), so an exemption can never ride a method no route answers.
An empty --api-key value is now a startup error rather than a server that looks guarded.

SSE. In the vendored httplib 0.46 an exception escaping a content provider aborts the
process; the provider ends the response instead. Upstream's 0.54 serve_guarded fixes the
cause -- the vendor lift is owed either way, and the catch is harmless belt until it.
2026-10-29 16:22:35 +01:00
fl0l0u a28221eb6a sched: refuse a prompt id that names no vocabulary row
The scored-prompt path (Request::token_scores) has always vetted its ids against the
vocabulary; the prompt itself never was. Raw id arrays arrive at admission verbatim from
the request body -- /v1/completions, /v1/embeddings and the generator take them -- and an
id past the embedding table is gathered by the step, fails it, and a failed step is a
device fault (spec 17): one request, {"prompt":[2147483647]}, ended every session on the
server. The check belongs at admission, where a refusal is a 400, not mid-pass, where it
is an exit.

The sched fixture's model declares 512 vocabulary rows and its requests spell prompts
from 1000 up; admission now refuses those, so the fixture's vocabulary moves above the
ids it uses.
2026-10-29 16:22:35 +01:00
mici81andClaude Opus 5.5 ed5f990d92 qwen MXFP4 feed-forward: the gated fold up to 16 rows, not 8
decl_gated_fold_mx declared gemm_nt_q_gated_mx over 1..8 rows only, from
before libr4d had gemm_mxfp4a8_gated_gemv_wide (9..64, byte-identical to
gemv_wide followed by gated_quant_fp8, the pair it replaces). TranslateGemma
already folds to 64 through RADIANCE_G3_FOLD_ROWS; Qwen's 16-row verify steps
(two sequences at speculation 7) still ran gate_up and gated_quant_fp8 apart.

Qwen3.8-27B MXFP4 + DFlash2 at TP2 on 2x R9700, production flags, ms a decode
step, three interleaved rounds (medians), the 1..8 band -> folding to 32:

  16 rows (x2):            1k 20.96 -> 20.78 (-0.9 %), 16k 21.96 -> 21.70 (-1.2 %)
  32 rows (x4):            1k 23.97 -> 24.10 (+0.5 %), 16k 26.06 -> 25.98
  32 rows (x8 short block): 1k 24.99 -> 25.14 (+0.6 %)

and 64 rows lost 2.1 % (16k x16) on the base before this main. So the band is
16: a taller step takes exactly main's path. Where the wide row does not
resolve (K at or under decode_shortk's corner), the declaration drops to 1..8
instead of losing the fold. Greedy output is identical to main (300 tokens,
two prompts).

arch_test: qwen35_fp8_mxfp4_feed_forward_folds_verify_steps_up_to_16_rows
(one and two sequences of 8 rows fold, three to eight take the pair).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-29 16:21:56 +01:00
baKon 187a015bda sched: tighten preempt gate headroom and test pool 2026-10-29 13:16:07 +01:00