Skip to content

v0.0.21

Choose a tag to compare

@github-actions github-actions released this 26 Aug 14:06
· 103 commits to main since this release
e7f839b

Chaos v0.0.21 — a model runs on the phone

Atur: "android can not do any one of works in windows and just can
connect windows". He was right: the dial offered four modes and only
CLIENT did anything. On an Android 34 emulator, with no PC involved:

you
What is the capital of France?

chaos
The capital of France is Paris.

7 tokens in 1.8s (3.938 tok/s), finish=stop
POST /v1/chat/completions -> 200 (stream) in 3.2s

chaos-serve is a library now. Everything the phone needed already existed
there -- the token loop, sampling, streaming, the endpoints -- and the
Kotlin client already spoke to it, so no second token loop was written.

The engine runs as a child process, not inside the app. Loading it in
worked for anything that did not make a thread; the moment
StreamingRunner::new called pthread_create the app died with
SIGSEGV/SEGV_ACCERR inside __init_tcb. A 16 MiB stack did not help,
moving to a JVM thread did not help, and the library has no PT_TLS
segment to blame. The same engine AS AN EXECUTABLE makes threads
perfectly on the same device -- chaos-run proved it in v0.0.19 -- so
Android does what the desktop has always done.

The launch screen

Both the window and the app now open on ONE QUESTION instead of six pages
of controls: a gas-stove dial, four detents across a 180 degree top
sweep, stops at both ends. Turn it, press, and the shell shows only what
that mode can do. Windows renders it per pixel because plain GDI has no
gradient fill; Android draws the same geometry with Canvas. The badge is
assets/logo.svg rendered per density and never redrawn. The logo animates
in first, and any key skips it. ESC on the desktop and CHANGE MODE on the
phone return to the dial.

Fixed

  • The logo rasteriser was 190x too slow at splash sizes: one repaint
    measured 1510 ms, and it is 8 ms now. logo_coverage supersamples 8x8
    over an n*SS grid, which is right at 44px where a ray is one pixel
    wide and wasted at 170 where it is four.
  • The dial's badge was invisible -- white ink on a white knob face,
    because the launcher's ink is white for a blue tile. 0 dark pixels in
    a screenshot; 825 now.
  • The mode labels were 0xFF111111 on a #0D1117 background, and ALONE
    was clipped off the left edge entirely.
  • The dial had a black surround; it has its own light ground now.
  • The phone's note said "THIS PHONE IS A CLIENT" in every mode.
  • Every size on the dial screen is a dimension resource, with values
    for sw360dp, sw600dp and h480dp.
  • The dial clicks as each detent is crossed.
  • ggml is built position-independent, for the cdylib that now links it.

Measured

  • Queue depth is worth 2.55x on the disk. Depth 1 gives 1.34 GiB/s,
    which reproduces what Chaos gets today and confirms it reads experts
    serially; depth 8 gives 3.41.

Retracted

  • The 5 tok/s ladder does not reach 5. It modelled a token as
    bytes/bandwidth and omitted the 0.84 s of arithmetic that never
    touches the disk. The rungs are 0.31 / 0.56 / 0.76 / 0.93 / 0.99.
  • And 5 tok/s is out of reach on this laptop at all: V4-Flash reads
    7.38 GiB of always-read weights every token, so at 30.8 GiB/s the
    ceiling is 4.17 tok/s with the disk free and no compute. 5 needs
    36.9 GiB/s for the trunk alone. Achievable here is 0.43 -> about 1.0,
    which agrees with the 1.19 ceiling found from the other direction.

Still not done

HELPER is reserved. chaos-worker speaks the protocol and is measured, but
no CORE routes an expert to it yet, and both the dial and the phone say
so.

889 tests.