Mo Elkholy (@moelkholy95) header
Mo Elkholy (@moelkholy95) profile picture

AI/ML eng | MSc Math & AI. Local LLMs on M5 Max 128GB: hybrid GGUF quants, long-context, Metal. Building agents & MCP tooling. Numbers over vibes.

Washington DC
Joined June 2026
Photo by Mo Elkholy (@moelkholy95)Photo by Mo Elkholy (@moelkholy95)Photo by Mo Elkholy (@moelkholy95)Photo by Mo Elkholy (@moelkholy95)Photo by Mo Elkholy (@moelkholy95)Photo by Mo Elkholy (@moelkholy95)Photo by Mo Elkholy (@moelkholy95)Photo by Mo Elkholy (@moelkholy95)Photo by Mo Elkholy (@moelkholy95)Photo by Mo Elkholy (@moelkholy95)
Most "make CI faster" advice makes CI lie. Add retries, skip the flaky tests, run fewer checks, and the build goes green sooner. I built an agent skill that refuses all three. ci-optimiser starts read-only, measures where your push-to-merge time goes (p50/p95 from your Actions history), then proposes one reversible, benchmarked change at a time. Default target: PR p50 under 120s, p95 under 180s. It only narrows PR feedback. The full suite still runs in the merge queue before main, and if the affected-test selector hits an input it can't classify, it runs everything. Give it to your agent. You'll thank me later.
4
7
228
Typing a config as Record<string, Route> lets routes.hoem.path compile. const routes: Record<string, Route> = { home: { path: "/", auth: false }, billing: { path: "/billing", auth: true }, }; routes.hoem.path; // no error, throws at runtime The annotation replaces the object's type with the Record, so TypeScript forgets which keys exist. satisfies, added in TS 4.9, checks the value against the type and keeps the inferred one: const routes = { home: { path: "/", auth: false }, billing: { path: "/billing", auth: true }, } satisfies Record<string, Route>; routes.hoem.path; // TS2339: Property 'hoem' does not exist You keep the check too. auth: "no" fails with TS2322. Checked with tsc 7.0.2 under strict.
1
1
122
TypeScript 4.9 release notes, the satisfies operator: typescriptlang.org/docs/hand…
1
10
You switch from Alice's chat to Bob's, and Bob's input still holds the message you were typing to Alice. <Chat contactId={id} /> React keeps a component's state as long as the same component renders at the same position in the tree. A new prop doesn't change that, so the draft in useState stays. The common patch is a useEffect that clears the draft when contactId changes. react.dev calls that inefficient: it renders once with the stale value, then again. Give React a key: <Chat key={id} contactId={id} /> A different key is a different component to React, so it drops the old state and mounts a fresh one. Tested on React 19.3 in jsdom. Typed a draft for alice, switched to bob. Without key the screen read "bob: hey alice, about the invoice". With key it read "bob: (empty)".
3
2
152
Your eval split changed between two runs, and both called np.random.seed(0). np.random.seed seeds one global RNG for the whole process. Any code that draws from np.random between your seed and your split shifts the stream. In my test, one np.random.rand() call from a stand-in "library" changed 2 of the first 5 indices. Give the split its own generator: def split(n, rng): return rng.permutation(n)[:5] idx = split(100, np.random.default_rng(0)) Same seed, same indices, whatever else touched np.random. NumPy's docs discourage the np.random functions because they run on a global RandomState, and tell you to create a Generator with default_rng instead. Pass rng explicitly through loading and sampling code. Then the randomness each function uses is in its signature.
2
2
120
NumPy random, Generator and default_rng: numpy.org/doc/stable/referen… Why the global functions are discouraged: numpy.org/doc/stable/referen…
1
10
You fan out 200 prompts with a TaskGroup and get a wall of 429s back. A TaskGroup starts every task right away. asyncio has no built-in cap on how many requests are in flight, so you add one. A Semaphore is the smallest way: sem = asyncio.Semaphore(8) async def bounded(p): async with sem: return await call_llm(p) async with asyncio.TaskGroup() as tg: tasks = [tg.create_task(bounded(p)) for p in prompts] results = [t.result() for t in tasks] I counted in-flight calls with a fake 50 ms call_llm: 200 at peak without the semaphore, 8 with it. Results still come back in prompt order because you read them from tasks, not in completion order. Pick the number from your provider's concurrency or rate limit, not from what feels fast.
1
16
Your Postgres job queue has 8 workers and they still take jobs one at a time. SELECT id FROM jobs WHERE status = 'queued' ORDER BY id LIMIT 1 FOR UPDATE; FOR UPDATE stops two workers from claiming the same row. Worker B doesn't skip A's row though. It blocks on the lock until A commits. Add SKIP LOCKED and B takes the next free row: UPDATE jobs SET status = 'running' WHERE id = ( SELECT id FROM jobs WHERE status = 'queued' ORDER BY id LIMIT 1 FOR UPDATE SKIP LOCKED ) RETURNING id; On PostgreSQL 19.0, with A holding its lock for 2 s: plain FOR UPDATE made B wait 1.5 s. With SKIP LOCKED, B got the next id in 27 ms. 4 workers making 25 claims each against 100 jobs got 100 distinct ids, no duplicates. The docs warn that skipping locked rows gives an inconsistent view of the data. That's fine for a queue table and wrong for reports.
1
17
errors.Is(err, ErrNotFound) returns false, and the message plainly says "not found". Someone wrapped it with %v: return fmt.Errorf("load %s: %v", id, ErrNotFound) %v turns the error into text. The message survives but the chain is gone, so errors.Is and errors.As have nothing to walk. Use %w: return fmt.Errorf("load %s: %w", id, ErrNotFound) Since Go 1.20 you can use %w more than once in a single Errorf, and errors.Is matches each wrapped error. One catch: errors.Unwrap returns nil on that error. It only calls Unwrap() error, and a multi-wrap error has Unwrap() []error. Checked on go1.27.3: %v gave false, %w gave true, two %w gave true for both, errors.Unwrap gave nil.
27
Every LLM engine I run on my M5 Max uses the GPU. The Neural Engine sits right next to it doing nothing. ANEMLL just published a hybrid that runs one model on both. Qwen3.8-27B at 3 bits on a 32GB M6: the FFNs go to the Neural Engine, where they run 1.56x faster per layer, and DeltaNet plus attention stay on the GPU. Both work at the same time during prefill. Their numbers against Splash 1.7.0, one matched run on their machine: 8K prompt: 685 vs 489 tok/s prefill 96K prompt: 389 vs 314 tok/s Decode: within -4% to +6% The memory trick is the part I like. A second copy of the weights wouldn't fit in 32GB, so the GPU kernels read the Neural Engine's compiled weights directly. 10.8 GiB mapped, zero copy. The catch: those compiled weights live in a system cache that SIP protects even from root. The research build needs SIP turned off from Recovery, only supports M6 on macOS 27.3, and has to be rebuilt after every macOS update. That's a dedicated test Mac, not your daily laptop. Long prompts are what coding agents wait on. If Apple ever ships a supported way to share weights between the two units, this is real prefill speed sitting unused.
4
4
290
Your tsconfig says "strict": true, and this still compiles: const scores: number[] = []; const best = scores[0]; best.toFixed(2); TypeScript types scores[0] as number, so it passes tsc --strict and then throws at runtime: Cannot read properties of undefined. strict doesn't turn on noUncheckedIndexedAccess. With it on, index reads on arrays and index signatures get | undefined: error TS18048: 'best' is possibly 'undefined'. Same for Record<string, T> lookups like byUser[id].name. New projects get it already: tsc --init has written "noUncheckedIndexedAccess": true since TS 5.9. A tsconfig from before that won't have it unless someone added it. Expect some noise in index loops. for...of and .map() don't trigger it.
1
38
Your React profile page can show the wrong user, and it only happens on a slow network. useEffect(() => { fetchUser(id).then(setProfile); }, [id]); Click user A, then B. If A's response lands after B's, setProfile runs with A's data last, and the screen shows A while B is selected. The fix from react.dev is a cleanup that ignores stale responses: useEffect(() => { let ignore = false; fetchUser(id).then((data) => { if (!ignore) setProfile(data); }); return () => { ignore = true; }; }, [id]); When id changes, React runs the old effect's cleanup before the new effect, so A's late response gets dropped. I reproduced it on React 19.3 in jsdom with A at 300ms and B at 50ms. The first version shows A, the second shows B. If your fetch takes an AbortSignal, aborting in the cleanup also cancels the request.
3
2
64
Your old checkpoint stopped loading after a PyTorch upgrade, and the error offers a fix you shouldn't take. Since PyTorch 2.6, torch.load defaults to weights_only=True. Tensors and state dicts load fine. A checkpoint that pickled one of your own classes, like a dataclass config, now fails with UnpicklingError. The quick fix is weights_only=False. That turns full pickle back on, and the PyTorch docs warn it "can result in arbitrary code execution." Fine for a file you made, a bad habit for anything you downloaded. Allowlist the class instead: from torch.serialization import add_safe_globals add_safe_globals([TrainConfig]) ckpt = torch.load("ckpt.pt") Or scope it to one load with torch.serialization.safe_globals([TrainConfig]) as a context manager. I checked on 2.15: the default load fails, the allowlisted load returns the config and the state dict.
1
16
PyTorch serialization notes, weights_only and safe_globals: docs.pytorch.org/docs/stable…
4