catalog / ports

NanoChat.NET

The .NET port of nanochat, graded capability by capability against the Python reference.

65 capabilities 2 sections extracted from NanoChat.NET source: D:\Dev\Lab\NanoChat.NET

Build against it

# give your agent the catalog — no account, no install
claude mcp add provespec -- npx -y provespec-mcp

# then, from any agent session
spec_get(slug: "nanochat-net")                → the capability tree
spec_checklist(slug: "nanochat-net")          → the questions to answer
spec_grade(slug: "nanochat-net", grades: [...])  → parity % + the gap list

# or just fetch it
curl https://provespec.com/catalog/nanochat-net/spec.json

Grade every capability below as yes · partial · no · na, with a file reference as evidence. Whatever you leave ungraded counts as missing — the gap list is the work queue.

Or just paste this to your agent

Use the ProveSpec MCP server. Fetch the "nanochat-net" spec with
spec_get, then walk spec_checklist and grade this repository against it —
one verdict per capability, each with a file reference as the note.
Call spec_grade with the results and give me the gap list as the plan.

If the server is not registered, add it first:
  claude mcp add provespec -- npx -y provespec-mcp

The specification

AI 57

Tokenizer
  • BPE tokenizer training BpeTokenizer.cs; extra <|eos|>/<|pad|> specials diverge vocab ids from upstream (PARITY.md 3.7)
  • GPT-4-style split pattern NanoChatSplitPattern.cs rune scanner, pinned by 4017-case corpus
  • tiktoken interop ImportPinnedNanoChatTiktoken + export_tiktoken_ranks.py; never exercised against a real upstream tokenizer.pkl
  • Chat special tokens 9 pinned PinnedNanoChatSpecialTokens, upstream order
  • Conversation render + loss mask NanoChatConversationRenderer.cs incl. python/output parts
  • Tokenizer persistence tokenizer.bin portable save/load (TokenizationRecords.cs)
  • Compression metrics TokenizationMetrics.cs, UTF-8-correct
Data pipeline
  • ClimbMix shard downloader ShardDownloader.cs: backoff, atomic rename
  • In-app Parquet ingestion only out-of-app tools/normalize_bpb_train.py -> JSONL (PARITY.md 4)
  • BOS best-fit packing loader ShardDataLoader.cs + BestFitPacker.cs with utilization stats
  • Resumable loader state ShardCursor.cs (shard,row,epoch)
  • SFT conversation packing ChatSftDatasetComposer.cs + ConversationObjective.cs
  • Upstream RNG reproduction PythonRandom/NumpyRandom.cs, verified vs CPython 3.12 / numpy 2.2.6
Model & kernels
  • GPT transformer (RoPE, QK-norm, relu2) NanoGpt.cs/TransformerBlock.cs, gradient-checked
  • Grouped-query attention incl. cached GQA windowed kernel
  • Sliding-window attention SSSL
  • Value embeddings + gates
  • Smear + backout
  • Optimized attention kernels custom CUDA own kernels, no FA3; cudaDeviceSynchronize after every launch, 53 sites (3.9)
  • Backward pass hand-written ~15 CUDA backward kernels, central-difference gradient-checked
Pretraining
  • Base training loop Trainer.cs + EngineService.cs (8 pipeline stages)
  • Muon + AdamW optimizer MuonAdamW.cs + optim.cu, verified; CPU stage trace mirror
  • LR/momentum/WD schedules TrainingSchedule.cs, verified at every boundary
  • Scaling-law autotuning opt-in PinnedTrainingScalePolicy.cs
  • Gradient accumulation GPU-resident; adds optional clipping beyond upstream (3.6)
  • Resume mid-run TrainingCheckpointStore.cs + TrainingRunSignature.cs validation
  • In-training evals & samples validate loop + telemetry; no in-training CORE/wandb equivalent
SFT
  • SFT training flow ChatSftSchedule.cs + TaskDataPipeline.cs (5 objective kinds)
  • Data mixture (SmolTalk+MMLU+GSM8K) ChatSftDatasetComposer.cs, upstream shuffle-then-cap order
  • Progress-driven LR schedule ChatSftProgressPolicy.cs
  • Optimizer warm-start from base resume exists, but no cross-stage momentum warm-start found
Reinforcement learning
  • GRPO rollouts & advantages GrpoRollout.cs, tested; PARITY.md 'absent' row is stale
  • RL training loop RlTrainingLoop.cs complete at model level; no UI activity, no rl lineage
  • pass@k evaluation MultiSampleProblemEvaluator.cs
Evaluation
  • CORE benchmark 22 tasks 3 scoring rules + few-shot sampler, verified; bundle projected to JSONL
  • Bits-per-byte metric BpbBenchmark.cs exact byte accounting; pilot with provenance
  • ChatCORE aggregate unscoreable while HumanEval is not executed (3.8)
  • GSM8K evaluation Gsm8kBenchmark.cs, durable resumable runs
  • HumanEval execution prepares 164 tasks but refuses to score without isolated executor (deliberate, D-02)
  • MMLU/ARC categorical eval pinned rendering + restricted answer labels
  • Inference benchmark InferenceBenchmark.cs: first-token latency + decode tok/s
  • Durable eval history & integrity EvaluationHistory.cs + BenchmarkFileIntegrity.cs (SHA-256 gates)
Inference engine
  • KV-cache incremental decode KvCache.cs + cached GQA windowed kernel
  • Prefill-once, clone-for-samples GenerateBatch loops different prompts; no KV-replicate n-row decode (B-3)
  • Streaming generation GenerateStream with per-token callback, cancellable
  • Temperature/top-k sampling InferenceOptions.cs
  • Calculator tool-use loop ToolUseStateMachine.cs + CalculatorTool.cs, Python-exact formatting
  • Multi-turn chat session ChatSession.cs, token-native with legacy fallback
  • CPU fallback inference CpuModel.cs, parity-tested against CUDA
Infrastructure
  • Checkpoint save/load + resume schema v11 atomic publish, latest.txt, mid-epoch resume
  • Model lineage registry (base/sft/rl) lineage/tag/step inventory exists; no rl lineage yet
  • Model deploy/rollback registry ModelRegistry.cs: register-activate-rollback per task kind
  • Artifact integrity (hashes) SHA-256 ModelArtifactStore.cs sidecars enforced by both loaders
  • Cross-implementation checkpoint import UpstreamCheckpointImporter.cs + exporter; never run against a real upstream checkpoint; no meta emission
  • Distributed multi-GPU training single-GPU only (3.5)
  • Mixed precision (bf16/FP8) fp32 only ~2x embedding/KV memory; open decision (3.3, D-01)
  • Config provenance tracking ConfigProvenance.cs: chosen vs derived, diffable vs upstream defaults

UI 8

  • Chat CLI no dotnet CLI entrypoint; WPF app or MCP only
  • Web chat UI no HTTP chat server counterpart
  • MCP server 21 tools ASP.NET MCP on port 5110: training/models/chat/datasets/inference/bpb-pilot
  • Desktop observatory app 18 activities WPF VsCode-style shell (Dpp.Nano.WinApp)
  • Architecture visualizers 12 renderers 41 synthetic Random sites; ~4 of ~99 render entry points read the real model
  • Interactive tokenizer explorer live retokenization, vocab + merge-history browsers
  • Training workflow UI TrainingActionCatalog.cs: actions with preconditions, run cards, ETA
  • End-to-end speedrun script no speedrun.sh equivalent
Download spec.json All 53 specs