open-standards/.m5.sh
Transaction Science 2c72f2b6d7
Some checks failed
jouleclaw fabrics / cuda (linux, RTX 4050 + Vulkan loader) (pull_request) Successful in 32s
jouleclaw fabrics / vulkan (linux, RTX 4050 + Vulkan loader) (pull_request) Successful in 31s
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 12s
repository checks / lockfiles, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Failing after 1m3s
standards workspaces build + test / mesh-rs (mesh/mesh-rs, -p mesh-engine-gguf -p mesh-openai --features mesh-engine-gguf/gguf,mesh-openai/server, mesh-rs, linux-arm64) (pull_request) Successful in 1m58s
standards workspaces build + test / jouleclaw-rs (-nodebug, jouleclaw/jouleclaw-rs, -p jouleclaw-energy --features rapl,nvml, jouleclaw-rs, linux-arm64, -C target-feature=+fp16) (pull_request) Successful in 4m14s
jouleclaw fabrics / metal (macOS, Apple GPU) (pull_request) Has been cancelled
jouleclaw public surface must stay documented / Public-surface audit (jouleclaw-rs) (pull_request) Has been cancelled
standards workspaces build + test / macOS energy backends (pull_request) Has been cancelled
standards workspaces build + test / jouledesk-rs (jouledesk/jouledesk-rs, jouledesk-rs, macos) (pull_request) Has been cancelled
jouleclaw-omni: the metal model references, 286 errors down to 111
Of the 286, 175 were one mistake repeated: `Model` was wrapped in
`Arc<RwLock<Model>>` and these files, never having been compiled, kept passing
`&self.model` where `&Model` was wanted. 169 call sites in 10 files now deref
the read guard, which is the idiom those same files already use elsewhere
(`self.model.read().get_weight(..)`).

Five stragglers were the same shape on a local rather than a field. The sixth
was a real boundary: parler_tts held `Arc<RwLock<Model>>` and called
`T5Encoder::new`, which takes `Arc<Model>`, as do its three other callers.

Two facts decided that one rather than guesswork. The conventions split 22
files on `Arc<Model>` against 16 on `Arc<RwLock<Model>>`, so the lock-free form
is the majority, not the exception -- changing T5Encoder would have dragged
three working callers toward the minority. And **no file ever takes a write
lock through it**: not one `model.write()` in any of the 16. The lock guards
read-only access. So parler_tts drops it and matches its callee.

That leaves the same simplification available across the other 15: an
`Arc<RwLock<Model>>` nobody writes through, and ~147 `&*self.model.read()`
derefs that exist only to satisfy it. Collapsing them to `Arc<Model>` would
delete both. Not done here -- the current state is correct, only
over-synchronised, and finishing the error count comes first.

errors 286 -> 111, with E0308 gone entirely. Default build unchanged at 0
errors and the same 29 warnings, 44 tests still passing.

What remains is mostly not drift but absence: 53 E0425 for things that do not
exist (27 of them the shader kernels `PHASE27_OPS`, `MATVEC`, `MATMUL_Q8_0`,
and ~20 `gpu_ops` helpers named `<op>_on`), 27 E0716 lifetime errors, 11 E0599
missing methods.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-10-20 03:58:06 -04:00

35 lines
1.4 KiB
Shell
Executable file

#!/bin/bash
cd "$(dirname "$0")"; export PATH="$HOME/.cargo/bin:$PATH"
M="--manifest-path jouleclaw/jouleclaw-rs/Cargo.toml -p jouleclaw-omni"
echo "=== metal ==="
timeout 3000 cargo check $M --features metal --keep-going --message-format=json -j 6 >/tmp/m5.json 2>/dev/null
python3 -c "
import json,collections
c=collections.Counter(); f=collections.Counter(); t=0
for l in open('/tmp/m5.json'):
try: m=json.loads(l)
except Exception: continue
if m.get('reason')!='compiler-message': continue
msg=m.get('message') or {}
if msg.get('level')!='error': continue
t+=1; c[(msg.get('code') or {}).get('code') or '?']+=1
sp=msg.get('spans') or []
if sp: f[sp[0]['file_name'].split('/')[-1]]+=1
print(f' errors={t} (3063 -> 286 -> 117 -> now)')
print(' by code:', dict(c.most_common(9)))
print(' worst:', dict(f.most_common(6)))"
echo "=== default must stay clean ==="
timeout 3000 cargo check $M --keep-going --message-format=json -j 6 >/tmp/d5.json 2>/dev/null
python3 -c "
import json
e=w=0
for l in open('/tmp/d5.json'):
try: m=json.loads(l)
except Exception: continue
if m.get('reason')!='compiler-message': continue
lvl=(m.get('message') or {}).get('level')
if lvl=='error': e+=1
elif lvl=='warning': w+=1
print(f' errors={e} warnings={w}')"
echo "=== tests ==="
timeout 3000 cargo test $M -j 6 >/tmp/t5.log 2>&1 && echo " PASS $(grep -m1 'test result:' /tmp/t5.log)" || echo " FAIL"