You are a participant in a controlled experiment. You will write the weights of a small neural network directly, by reasoning and arithmetic. There is no training step and you will never see the data. The network is then executed by an independent judge on a sealed test set that you will not see. You are not told the score.

Your working folder is:
{FOLDER}
It is your only workspace. Use absolute paths. It already contains check_spec.py (a validator).

## Task
Handwritten digit classification on the standard MNIST test set (10 classes, digits 0 to 9).
Input tensor: shape (1, 28, 28), float32, pixel value divided by 255 so the range is [0, 1]. No other normalisation. Strokes are bright on a dark background, as in the original dataset, with digits size-normalised and centred by centre of mass.
Output: 10 logits. The prediction is argmax; class index equals the digit.
Metric: accuracy on the sealed test set.

## Architecture language
The network is a sequential model or a simple DAG of standard layers, described in spec.json. No custom code, no lookup outside the weights, no conditionals.

spec.json format:
{"input_shape": [1, 28, 28], "output": "<name of the last layer>", "layers": [ <layer>, <layer>, ... ]}

Layers are listed in topological order. Each layer has a unique "name" and reads from "input" (the name of an earlier layer, or the literal "input" for the network input). Inputs have a batch dimension that the spec does not mention. The allowed layers are these, with PyTorch semantics exactly:
- {"name":..., "op":"Conv2d", "input":..., "in_channels":C, "out_channels":C2, "kernel_size":k, "stride":1, "padding":0, "bias":true}  (square kernels, integers; stride, padding and bias are optional with these defaults)
- {"name":..., "op":"Linear", "input":..., "in_features":n, "out_features":m, "bias":true}
- {"name":..., "op":"ReLU", "input":...}
- {"name":..., "op":"MaxPool2d", "input":..., "kernel_size":k, "stride":k, "padding":0}  (stride defaults to kernel_size)
- {"name":..., "op":"AvgPool2d", "input":..., "kernel_size":k, "stride":k, "padding":0}
- {"name":..., "op":"Flatten", "input":...}  (flattens everything after the batch dimension, in C order)
- {"name":..., "op":"Concat", "inputs":[name1, name2, ...]}  (concatenates along channel dimension for 4-d tensors, feature dimension for 2-d tensors; 2 or more inputs)

weights.npz holds one array per parameter: "<layer name>.weight" and, when bias is true, "<layer name>.bias". Shapes follow PyTorch: Conv2d weight (out_channels, in_channels, k, k), bias (out_channels); Linear weight (out_features, in_features), bias (out_features). No other keys. Values must be finite. They are loaded as float32.

Parameter cap for this task: 100,000. The count is the total number of entries in weights.npz, zeros included.
A network whose files do not validate, or do not execute, is scored at chance. That is recorded, not dropped.

## Rules (a run that breaks one is thrown out and replaced)
1. Stay inside your folder. Do not read, list or search anything outside it. Do not look at the Python install, the home directory or any other project. Do not check whether any dataset is cached on this machine.
2. No dataset of any kind. Do not read, download or import any data. Do not import torchvision, torch, sklearn, tensorflow, datasets, scipy, PIL or similar. Do not use the internet. Tools: use only Bash, Read, Write and Edit. Do not use WebSearch, WebFetch, ToolSearch, Skill or Agent, and do not start other agents. Do not load any skill; NOTES.md is a technical log, not reader-facing prose.
3. Nothing is trained or fitted. No gradient steps, no perceptron or iterative updates, no least squares, pinv or other matrix solves to fit targets, on any data, real or synthetic. Weights must come from your own reasoning: explicit numbers, formulas, or closed-form computation from things you write from memory yourself (for example, a stroke template you rasterise, or counts over word lists you recall).
4. Zero forward passes. You may not execute the network, or any part of it, in any form (numpy, by hand in code, or otherwise) on any input, real or invented. Do not write a simulator of your network. Reasoning about its behaviour in your head and on paper is what this experiment is. Running check_spec.py is allowed; it only checks shapes and counts.

## What you must leave in your folder
- build_weights.py: when run as `python3 build_weights.py` with no arguments, it writes weights.npz and spec.json next to itself (use the folder of __file__). It imports only numpy and these standard library modules: json, math, os, sys, itertools, collections, functools, unicodedata, struct, re, string, pathlib, typing, dataclasses. It reads no other file; everything it needs is inside the script. It finishes in under 120 seconds. It must be deterministic: a judge reruns it under a sandbox with no network and no file access outside the folder and compares the output bytes. If the rerun does not reproduce your weights, the network is scored at chance. Use np.savez (not savez_compressed); seed any randomness; do not embed dates.
- weights.npz and spec.json, produced by running that script.
- NOTES.md: your reasoning, and one line accounting for each block of weights (what that block does and where its numbers came from).

Run `python3 {FOLDER}/check_spec.py mnist {FOLDER}` at the end and make it print OK.

Aim to finish in about 25 minutes. Your reply when finished must be one line: DONE, or FAILED and why. Do not include anything else in the reply.
