Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions .github/workflows/atoma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,40 +258,52 @@ jobs:
if-no-files-found: error
retention-days: 30

coq_pin_selftest:
name: Pinned Coq rejects a corrupted checksum
native_word:
name: Proven native word replay
runs-on: ubuntu-24.04
timeout-minutes: 10
timeout-minutes: 20
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Cache pinned Coq packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
- name: Provision pinned Zig and independent Coq checker
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends coq=8.18.0+dfsg-1build2 binutils xxd
bash scripts/atoma-download-zig.sh "$RUNNER_TEMP/atoma-native-word-zig"
- name: Capture and replay the linked Proven decoder
run: |
set -euo pipefail
mkdir -p build/atoma-evidence
bash scripts/atoma-native-word.sh check build/atoma-evidence/native-word
bash scripts/atoma-native-word.sh replay build/atoma-evidence/native-word
- uses: actions/upload-artifact@v7.0.2
if: always()
with:
path: ${{ runner.temp }}/atoma-coq-debs
key: coq-8.18-debs-${{ hashFiles('ci/coq-8.18.debs.sha256') }}
- name: Negative self-test (a flipped sha256 must fail verification)
run: bash scripts/atoma-provision-coq.sh --self-test-bad-sha "$RUNNER_TEMP/atoma-coq-debs"
name: proven-native-word-evidence-${{ github.sha }}
path: build/atoma-evidence/native-word/
if-no-files-found: error
retention-days: 30

soundness:
name: Atoma soundness gate
needs: [core_soundness, heap_consumers, byte_translation, coq_pin_selftest]
needs: [core_soundness, heap_consumers, byte_translation, native_word]
if: ${{ always() }}
runs-on: ubuntu-24.04
timeout-minutes: 2
steps:
- name: Require existing replay, heap pilots and native byte validation
- name: Require replay, heap pilots, byte validation and native decoder
env:
CORE_RESULT: ${{ needs.core_soundness.result }}
HEAP_RESULT: ${{ needs.heap_consumers.result }}
TRANSLATION_RESULT: ${{ needs.byte_translation.result }}
COQ_PIN_RESULT: ${{ needs.coq_pin_selftest.result }}
NATIVE_WORD_RESULT: ${{ needs.native_word.result }}
run: |
test "$CORE_RESULT" = success
test "$HEAP_RESULT" = success
test "$TRANSLATION_RESULT" = success
test "$COQ_PIN_RESULT" = success
test "$NATIVE_WORD_RESULT" = success

gate:
name: CI/gate
Comment thread
hyperpolymath marked this conversation as resolved.
Resolved
Expand Down
37 changes: 37 additions & 0 deletions docs/decisions/ATOMA-BOUNDARY-SOURCE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,43 @@ These are re-proved legs, not transported proof objects. Statement
correspondence is BRIDGE-PENDING; no PWG upgrade, external verified-checker
qualification or Mathesis admission follows automatically.

== Compiled Proven decoder observation

The additional native gate uses the Proven decoder and its literal imported
encoder at the commit in `tests/consumer-word/proven.pin`. It checks both SHA-256
locks and builds only those snapshots. A test-only Zig C ABI bridge calls
`decodeWord(u64)` and returns a `u16` with values 0 through 255 for successful
decodes and 256 for `InvalidRefcResult`. The gate compiles the pure Zig observer
and bridge into separate objects, checks their undefined and defined ELF
symbols, and statically links them. It uses Zig 0.15.2, `x86_64-linux-musl`,
baseline CPU, Debug, LLVM and no LTO.

For each byte in ascending order, the observer visits its canonical word,
every single-bit corruption at positions 0–31 and 40–63 in ascending order, and
the combined corruption at positions 1 and 40. The final input is the largest
`u64`. Each of the 14,849 ten-byte records carries the actual `u64` argument
and `u16` result in little-endian order. Coq derives the ordered corpus
independently, checks both fields against the model, and applies the admitted
source correspondence theorem to the 256 accepted and 14,593 refused calls.

A separately compiled decoder mutation accepts one planned mixed corruption
through the same bridge symbol and the proof rejects its observed group. Other controls exchange
two refused inputs without changing their results, replace a returned 255 with
a refusal, truncate the trace, and change each pinned snapshot. The evidence
binds the original sources, tool identities and build commands, both objects,
the executable, the raw capture and its checked Coq capsule. CI runs the
archived executable again and requires byte-for-byte agreement.

The gate keeps an `INCOMPLETE` receipt for the bounded observation. All-input
machine-code and compiler correspondence, foreign ABI refinement and the RefC
runtime path remain open. The existing Proven and UAA Idris-oracle pilots and
strict theory checks remain required.

[source,bash]
----
bash scripts/atoma-native-word.sh replay PATH_TO_TRUSTED_NATIVE_EVIDENCE
----

== Ownership and execution premises still owed

* A live registry has one serialized owner; concurrent operations are outside scope.
Expand Down
9 changes: 9 additions & 0 deletions docs/status/PROOF-STATUS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,12 @@ The policy claims table is not promoted by these additions.
See link:../decisions/ATOMA-HEAP-BOUNDARY.adoc[scope and native correspondence
premises]. All hand re-proof correspondence remains BRIDGE-PENDING.

== Compiled Proven word-decoder slice

The required native job checks 14,849 ordered calls to the linked
`decodeWord` bridge against the exact source capsule and arithmetic model.
The exact workflow head and its artifact own the execution status. The
`INCOMPLETE` receipt leaves all-input native, compiler, foreign ABI and RefC
runtime refinement open. See link:../decisions/ATOMA-BOUNDARY-SOURCE.adoc[scope
and replay instructions].

9 changes: 9 additions & 0 deletions examples/atoma/proven-word/bridge.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: MPL-2.0
// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
const decoder = @import("bits8_decode_word.zig");

// This test-only C ABI retains all 256 byte values and a separate refusal code.
export fn atoma_proven_decode_word(raw: u64) callconv(.c) u16 {
const byte = decoder.decodeWord(raw) catch return 256;
return byte;
}
35 changes: 35 additions & 0 deletions examples/atoma/proven-word/observer.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// SPDX-License-Identifier: MPL-2.0
// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
const std = @import("std");

comptime {
_ = std.start;
}

extern fn atoma_proven_decode_word(raw: u64) callconv(.c) u16;

// Each record carries the actual argument and result, both little-endian.
fn record(out: *[10]u8, raw: u64) void {
std.mem.writeInt(u64, out[0..8], raw, .little);
std.mem.writeInt(u16, out[8..10], atoma_proven_decode_word(raw), .little);
}

pub fn main() !void {
const stdout = std.fs.File.stdout();
for (0..256) |byte| {
const canonical = (@as(u64, byte) << 32) | 1;
var rows: [58][10]u8 = undefined;
record(&rows[0], canonical);
var index: usize = 1;
for (0..64) |bit| {
if (32 <= bit and bit < 40) continue;
record(&rows[index], canonical ^ (@as(u64, 1) << @as(u6, @intCast(bit))));
index += 1;
}
record(&rows[index], canonical ^ ((@as(u64, 1) << 1) | (@as(u64, 1) << 40)));
try stdout.writeAll(std.mem.asBytes(&rows));
}
var maximum: [10]u8 = undefined;
record(&maximum, std.math.maxInt(u64));
try stdout.writeAll(&maximum);
}
Loading
Loading