03Implementation

Crash-Proof Flash Filesystem

#ModelScoreStepsIn tokOut tokAvg costAvg time
1Claude Fable 5.1
0.7779
±0.428
24995.4M448k$58.573.7h
2Grok 4.6
0.0209
±0.024
1,452393.7M2.0M$402.9414.4h
3GPT-5.6
0.0204
±0.003
31192.1M204k$94.522.4h
4Kimi K3
0.0130
±0.017
1,170513.6M1.6M$188.9519.9h
5GLM-5.3
0.0109
±0.006
1,338596.2M1.2M$163.9619.0h
6Gemini 3.7 Flash
0.0082
±0.008
1,878756.6M1.9M$87.0620.0h
7DeepSeek V4 Flash Exp
0.0062
±0.003
2,8941331.7M2.3M$22.2219.3h
8Muse Spark 1.2
0.0033
±0.002
415184.7M495k$31.672.7h
9Qwen3.8-Max
0.0003
±0.001
14216.9M1.4M$12.6619.3h
10Inkling
0.0000
±0.000
16713.6M26k$13.030.7h

Background

Filesystems for NOR flash live under constraints that desktop filesystems never face: writes only flip bits one way until a whole block is erased, blocks wear out after a bounded number of erase cycles, and embedded devices can lose power at any instant. A correct design must guarantee that power loss between any two operations never corrupts the filesystem, while spreading erases across the device and keeping RAM usage tiny.

The task workspace is derived from a production embedded filesystem, de-branded so the agent cannot simply recall the implementation: the test and bench suites define the behavior, and the agent has to reconstruct the design from what they pin down.

Task

Implement the filesystem in Zig inside /app/flash-fs/, exporting C-compatible symbols (export fn, callconv(.c)) that match what the test suites call. Using @cImport to wrap existing C code is not allowed; the filesystem itself must be written in Zig.

  • The tests/ suites are white-box: they read raw on-disk metadata directly, so correctness means reproducing the exact on-disk block-device state they pin down, not merely passing at the API surface.
  • Survive simulated power loss at every point the suites inject it, across multiple block-device geometries.
  • The benches/ suites measure bytes read, bytes programmed, and blocks erased; lower is better.
  • Every suite runs under a fixed per-suite time cap that counts as failed if exceeded.

What The Agent Gets

A ready-to-run Zig project at /app/flash-fs/: the correctness suites in tests/, the flash-I/O efficiency suites in benches/, an emulated block device, the test runner, and a build system driven by ./build_and_test.sh (all suites) or ./build_and_test.sh <suite> (one). The machine is offline; everything needed is preinstalled, including the Zig toolchain.

Verification

A clean-room verifier, separate from the agent's environment, rebuilds the submission and runs the hidden versions of the suites. The scored answer key is the reference implementation's per-permutation block-device checksums across four flash geometries, so credit requires a genuinely working filesystem that produces the exact on-disk state; a recalled description of the original design is not enough.

  • Correctness comes from the hidden test suites; efficiency is scored on deterministic emulated-flash I/O counters (bytes read/programmed, blocks erased), not wall-clock time.
  • Build failures, missing symbols, and anti-cheat violations zero the result.

Environment

Base imageubuntu:24.04
Tools availableZig, C/C++ toolchain, Python 3
Compute4 CPUs · 4 GB RAM
Time limit20h

References

  • littlefs (BSD-3-Clause): The test framework, test/bench suites, block-device emulation, build system, and the reference implementation used only by the oracle (v2.11, on-disk format 2.1). Agent-visible copies are de-branded as an anti-contamination measure; SPDX license headers are retained in the vendored files.