interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

GitHub aien-dev/aienux#356 (code only)

closed derived cbea42d44a296beb #356

Imported from GitHub aien-dev/aienux#356 (code only)

GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).

Base cfff5ee476220e6f4d414511a4d44a936d7fe82e · Head 3e262f430a6dedcff067b2fcf3a240d802c7fbca

Apply it

git checkout -b patch-cbea42d44a296beb cfff5ee476220e6f4d414511a4d44a936d7fe82e
curl -fsSL https://interplane.io/drakestapleton/aienux/patches/cbea42d44a296beb.patch | git am

Raw patch (mbox) · Diff

Provenance

This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:

github-import 1
aien-dev/aienux
356
3e262f430a6dedcff067b2fcf3a240d802c7fbca
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":356,"url":"https://github.com/aien-dev/aienux/pull/356","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:16Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index 4ab2b7a7..69825bd6 100644
--- a/.crumb
+++ b/.crumb
@@ -28,32 +28,32 @@
         },
         {
           "digest": "b3206a74cb029a51277f86e5e41b11e87b1b0a8266e0eb3e4d6c9bde8599695a",
-          "last_commit": "dbcc813",
+          "last_commit": "cfff5ee",
           "name": "docs",
           "purpose": "Directory docs. Purpose not yet described by a human."
         },
         {
-          "digest": "6760e8dde3217be76eca9feda31df7a6cc46c9d800e393f9bf9e6684a7745c2b",
-          "last_commit": "65466db",
+          "digest": "4b3233c5f18d4c11224b31eaf4a33151f7cb010b854bb2acc8462ae83a030fcf",
+          "last_commit": "7dad96f",
           "name": "native",
           "purpose": "Directory native. Purpose not yet described by a human."
         },
         {
-          "digest": "7d0a21caf52696488c30c66204426d875d73cc672162cf9bcbe7eb34d6cc77b2",
-          "last_commit": "65466db",
+          "digest": "7db7f93211cc0ea2a7dab1657474188f3040f71d568d0e41bc21b931cd28e6b5",
+          "last_commit": "d3fcbcd",
           "name": "scripts",
           "purpose": "Directory scripts. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:5fc62abdda4de084c4a1f3848c349dcbec7c4ca75adac1252dfd80171d200b00",
-      "compiled_at": "2026-10-13T14:14:52Z",
+      "children_root": "sha256:748cb6ace95c1a41f4c32de2271e8d5bd33a33caf1f1ba7e238818a63a8e56ca",
+      "compiled_at": "2026-10-13T14:40:44Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:33f43bda17813bb2f44af036190fc03b22ee159e4d4791ae5b056cc9868aea36",
+      "digest": "sha256:c4247a4ba28e5d57b2b12bb432e9b12e81b1e6d906cb2795525ee8c344c4dc08",
       "evidence_files": 156,
       "evidence_root": "sha256:cd53ab119be9de6ce28c4f5949b106c9622f1fe105611de3de21c3bce7932694",
       "files": 3149,
-      "generated_at_commit": "dbcc8133ea836912906f685ebe3198e844ee3efd",
-      "source_tree": "sha256:4ecbdcfbb65655d93c2df4db45a588813f8777fc0f42009099a2b74006e3f0a9"
+      "generated_at_commit": "1fd895aef29f2163f075e7b35bb13fa2c9389192",
+      "source_tree": "sha256:0a4d11d103fefbf939168b2ba6b77a604859ed7c8a8f79d6981d8343faa93ca8"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/.github/workflows/ck-kernel.yml b/.github/workflows/ck-kernel.yml
index 73f8ce23..585bd052 100644
--- a/.github/workflows/ck-kernel.yml
+++ b/.github/workflows/ck-kernel.yml
@@ -112,6 +112,10 @@ jobs:
         run: |
           sudo apt-get update
           sudo apt-get install -y build-essential qemu-system-arm qemu-efi-aarch64 socat
+      - name: Install Rust toolchain (make pi5-infer links the aarch64-unknown-none inference crate)
+        uses: dtolnay/rust-toolchain@stable
+        with:
+          targets: aarch64-unknown-none
       - name: Vendored Omega Cortex store matches omega.lock (P06 cut 3; shallow fetch of the pinned omega commit)
         run: bash scripts/omega_lock_check.sh
       - name: "Stage sources compile freestanding (nm -u: ck.h services only)"
diff --git a/native/.crumb b/native/.crumb
index f744f0d6..e43b170b 100644
--- a/native/.crumb
+++ b/native/.crumb
@@ -79,8 +79,8 @@
           "purpose": "Directory native/disk. Purpose not yet described by a human."
         },
         {
-          "digest": "cb707e08fd33858c86ee4ea866a2decfac90c6082a2cf28f058e9c8659b16325",
-          "last_commit": "b46b6ba",
+          "digest": "d64a164129945f560d4500f05bf71145a6b289b4f2b03b51af3c03c36099a367",
+          "last_commit": "7dad96f",
           "name": "kernel",
           "purpose": "Directory native/kernel. Purpose not yet described by a human."
         },
@@ -109,15 +109,15 @@
           "purpose": "Directory native/store. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:14ea3543173742c8bd1f415a402493b970e1e2bcd0c563a55848d36f5d347a26",
-      "compiled_at": "2026-10-13T13:46:16Z",
+      "children_root": "sha256:525a54e64fb825e93dcf221878fc294e343afd1fb951c562834195de3b61f0d1",
+      "compiled_at": "2026-10-13T14:40:44Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:6760e8dde3217be76eca9feda31df7a6cc46c9d800e393f9bf9e6684a7745c2b",
+      "digest": "sha256:4b3233c5f18d4c11224b31eaf4a33151f7cb010b854bb2acc8462ae83a030fcf",
       "evidence_files": 4,
       "evidence_root": "sha256:e410b845507e00568e15b51a5797af32a97e0e4b8ab4e8487bb7c98e7e0cf335",
       "files": 515,
-      "generated_at_commit": "b46b6ba4c5f031ff1d0d8cf3ea31b5093fbd2f4f",
-      "source_tree": "sha256:c7b131dab16f97f00cb2f4a9bb8ea6df49fb832e57afcddcfa19556e75d0cbfd"
+      "generated_at_commit": "1fd895aef29f2163f075e7b35bb13fa2c9389192",
+      "source_tree": "sha256:5d12b16d90a1fe7d62557c24e9495a572918d161cb2f1e80feb3130051bce863"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/.crumb b/native/kernel/.crumb
index b58ad263..439ccf93 100644
--- a/native/kernel/.crumb
+++ b/native/kernel/.crumb
@@ -57,8 +57,8 @@
           "purpose": "Directory native/kernel/artifact. Purpose not yet described by a human."
         },
         {
-          "digest": "529a021d03c4e1cf694893510716289c757f84928a6c1af23a6ce42678a392ea",
-          "last_commit": "b46b6ba",
+          "digest": "59ed62d9cc65c8b4a4fd0a8abef018cc6fc05eba56ead699ad50ae25cbfd4e3a",
+          "last_commit": "d3fcbcd",
           "name": "core",
           "purpose": "Directory native/kernel/core. Purpose not yet described by a human."
         },
@@ -88,7 +88,7 @@
         },
         {
           "digest": "5af2f3acb130b4996f485e8ceeb838a3447ced577272c9d455861007537ce6e8",
-          "last_commit": "b46b6ba",
+          "last_commit": "65466db",
           "name": "tests",
           "purpose": "Directory native/kernel/tests. Purpose not yet described by a human."
         },
@@ -99,15 +99,15 @@
           "purpose": "Hosted (Linux-built) checkers for the native kernel, run by `make -C native/kernel test`; nothin"
         }
       ],
-      "children_root": "sha256:a806cc88ff806519c3baaf833e9bc4ae20a286adddec629d813c5269c8bfda17",
-      "compiled_at": "2026-10-13T13:46:16Z",
+      "children_root": "sha256:fe2c7cc24f5d8315fef2e2029545ed8f6589d0e7a0f9b7aac974cf91530f6ff5",
+      "compiled_at": "2026-10-13T14:40:44Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:cb707e08fd33858c86ee4ea866a2decfac90c6082a2cf28f058e9c8659b16325",
+      "digest": "sha256:d64a164129945f560d4500f05bf71145a6b289b4f2b03b51af3c03c36099a367",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 338,
-      "generated_at_commit": "b46b6ba4c5f031ff1d0d8cf3ea31b5093fbd2f4f",
-      "source_tree": "sha256:81addc4c127a5ceabc06bf9e8c07484b169adf3b9d4e9f7cb59665af521bfc78"
+      "generated_at_commit": "1fd895aef29f2163f075e7b35bb13fa2c9389192",
+      "source_tree": "sha256:caa23b6a8c570873c3295a5a811040423d277f34b2ebdd710b0a42b2a77b65b7"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/Makefile b/native/kernel/Makefile
index 95eed634..8e3d4d7e 100644
--- a/native/kernel/Makefile
+++ b/native/kernel/Makefile
@@ -150,6 +150,25 @@ CK_PI5 := 1
 OUT ?= $(REPO)/target/native-kernel-pi5-store
 CK_EXTRA_CFLAGS += -DCK_PI5_STORE=1
 endif
+# Pi 5 inference image (CK_PI5_INFER=1, "make pi5-infer", PI5-6 cut 2): the plain Pi image plus
+# the Rust inference unit (CK_INFER_LIB) and core/infer.c as the one-shot boot-disk probe. Model
+# source is MODEL.MAP only (-DCK_INFER_DISK_ONLY=1): no fw_cfg code, and with no map the kernel
+# refuses. No Store stage, no service, no resident session. Own OUT; plain pi5 / pi5-store unchanged.
+CK_PI5_INFER ?=
+ifneq ($(strip $(CK_PI5_INFER)),)
+ifneq ($(strip $(CK_PI5_INFER)),1)
+$(error CK_PI5_INFER must be empty or 1)
+endif
+ifneq ($(strip $(CK_PI5_STORE)$(CK_SERVICE)$(CK_HARDWARE_STAGING)$(CK_TEST_FWCFG_ARTIFACTS)$(CK_RUST_LIBS)),)
+$(error CK_PI5_INFER is the one-shot Pi inference image: it cannot be combined with CK_PI5_STORE, CK_SERVICE, CK_HARDWARE_STAGING, CK_TEST_FWCFG_ARTIFACTS or CK_RUST_LIBS)
+endif
+ifeq ($(strip $(CK_INFER_LIB)),)
+$(error CK_PI5_INFER needs CK_INFER_LIB=<libaienos_infer_kernel.a> (use "make pi5-infer", which builds it))
+endif
+CK_PI5 := 1
+OUT ?= $(REPO)/target/native-kernel-pi5-infer
+CK_EXTRA_CFLAGS += -DCK_PI5_INFER=1 -DCK_INFER_DISK_ONLY=1
+endif
 CK_PI5 ?=
 ifneq ($(strip $(CK_PI5)),)
 ifneq ($(strip $(CK_PI5)),1)
@@ -876,7 +895,7 @@ $(foreach s,$(STAGE_SRCS),$(eval $(call stage_rule,$(s))))
 # with inference (CK_INFER_LIB + CK_HARDWARE_STAGING, boot-disk only) must
 # carry the boot-disk source line, the resident session, and no fw_cfg code.
 define fwcfg_check
-	@if [ -n "$(strip $(CK_INFER_LIB))" ] && [ -z "$(strip $(CK_HARDWARE_STAGING))" ]; then \
+	@if [ -n "$(strip $(CK_INFER_LIB))" ] && [ -z "$(strip $(CK_HARDWARE_STAGING))" ] && [ -z "$(strip $(CK_PI5_INFER))" ]; then \
 	  grep -aqF "TEST-ONLY QEMU fw_cfg model ingest" $(1) || { echo "inference probe image lacks its TEST-ONLY fw_cfg announcement"; rm -f $(1); exit 1; }; \
 	elif [ "$(strip $(CK_TEST_FWCFG_ARTIFACTS))" = 1 ]; then \
 	  grep -aqF "TEST-ONLY QEMU fw_cfg side channel" $(1) || { echo "test fw_cfg image lacks its TEST-ONLY announcement"; rm -f $(1); exit 1; }; \
@@ -886,7 +905,7 @@ define fwcfg_check
 	  if [ -n "$$s$$y" ]; then echo "default image carries fw_cfg artifact code: $$s$$y"; rm -f $(1); exit 1; fi; \
 	  if [ -n "$(strip $(CK_INFER_LIB))" ]; then \
 	    grep -aqF "infer_source_mode: boot-disk model" $(1) || { echo "hardware inference image lacks the boot-disk model source"; rm -f $(1); exit 1; }; \
-	    grep -aqF "infer: resident open" $(1) || { echo "hardware inference image lacks the resident session"; rm -f $(1); exit 1; }; \
+	    if [ -z "$(strip $(CK_PI5_INFER))" ]; then grep -aqF "infer: resident open" $(1) || { echo "hardware inference image lacks the resident session"; rm -f $(1); exit 1; }; fi; \
 	    echo "hardware inference image: boot-disk model source only, no fw_cfg code in $(1)"; \
 	  fi; \
 	  echo "no fw_cfg artifact code in $(1)"; \
@@ -1814,6 +1833,11 @@ pi5-diag: $(PI5DIAG_EFI)
 pi5-store:
 	$(MAKE) CK_PI5_STORE=1 full
 
+PI5_INFER_LIB := $(REPO)/target/infer-kernel/aarch64-unknown-none/release/libaienos_infer_kernel.a
+pi5-infer:
+	CARGO_TARGET_DIR=$(REPO)/target/infer-kernel cargo build -q --release --target aarch64-unknown-none --manifest-path $(REPO)/crates/aienos-infer-kernel/Cargo.toml
+	$(MAKE) CK_PI5_INFER=1 CK_INFER_LIB=$(PI5_INFER_LIB) all
+
 pi5:
 	$(MAKE) CK_PI5=1 all
 
@@ -1865,7 +1889,7 @@ $(OUT)/host-san/test_pi5_rng: $(KDIR)/tests/test_pi5_rng.c $(PI5_RNG_SRCS) $(KDI
 
 FORCE:
 .PHONY: uefi-vars slot-loader slot-loader-check pi5-diag
-.PHONY: all full pi5 pi5-store test sanitize handoff-mutant acpi-dev-mutant iort-mutants smmu-l2-mutants acpi-scan clean print-kcflags udp-echo tool store-image gpt-image cont-tool owner-gen fb-check continuity-mutants continuity-resolve-mutants FORCE
+.PHONY: all full pi5 pi5-store pi5-infer test sanitize handoff-mutant acpi-dev-mutant iort-mutants smmu-l2-mutants acpi-scan clean print-kcflags udp-echo tool store-image gpt-image cont-tool owner-gen fb-check continuity-mutants continuity-resolve-mutants FORCE
 
 # AIENOS-PI5 step 3 marker + Pi card GPT test (hosted; a file stands in for the card, QEMU cannot model the Pi SD host).
 PI5_MARKER_SRCS := $(KDIR)/core/pi5_marker.c $(KDIR)/dev/disk_part.c $(NATIVE)/disk/disk.c $(NATIVE)/disk/disk_file.c \
diff --git a/native/kernel/core/.crumb b/native/kernel/core/.crumb
index be411ca1..d249cecb 100644
--- a/native/kernel/core/.crumb
+++ b/native/kernel/core/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-13T13:46:16Z",
+      "compiled_at": "2026-10-13T14:40:44Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:529a021d03c4e1cf694893510716289c757f84928a6c1af23a6ce42678a392ea",
+      "digest": "sha256:59ed62d9cc65c8b4a4fd0a8abef018cc6fc05eba56ead699ad50ae25cbfd4e3a",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 55,
-      "generated_at_commit": "b46b6ba4c5f031ff1d0d8cf3ea31b5093fbd2f4f",
-      "source_tree": "sha256:5e0cf1b942db60fc53c255179fed893ae2f6b27d87c0774b82d21146253b6780"
+      "generated_at_commit": "1fd895aef29f2163f075e7b35bb13fa2c9389192",
+      "source_tree": "sha256:0671fcd1367c59c78e6d2b3b93bd05dff2a268aa4d2e5a8bcc24cc462b01c8d1"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/core/infer.c b/native/kernel/core/infer.c
index 32f37f84..dec7ce4e 100644
--- a/native/kernel/core/infer.c
+++ b/native/kernel/core/infer.c
@@ -37,8 +37,8 @@
 
 #ifdef CK_INFER_PROBE
 #include "sha256.h"
-#if defined(CK_INFER_DISK_ONLY) && !defined(CK_INFER_RESIDENT)
-#error "CK_INFER_DISK_ONLY is the hardware service image (CK_SERVICE=1 + CK_INFER_LIB + CK_HARDWARE_STAGING) only"
+#if defined(CK_INFER_DISK_ONLY) && !defined(CK_INFER_RESIDENT) && !defined(CK_PI5_INFER)
+#error "CK_INFER_DISK_ONLY is the hardware service image (CK_SERVICE=1 + CK_INFER_LIB + CK_HARDWARE_STAGING) or the Pi one-shot image (CK_PI5_INFER) only"
 #endif
 
 extern void aienos_infer_heap_init(uintptr_t base, uintptr_t len);
diff --git a/scripts/.crumb b/scripts/.crumb
index c9c145c8..e5af2d57 100644
--- a/scripts/.crumb
+++ b/scripts/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-13T13:46:16Z",
+      "compiled_at": "2026-10-13T14:40:44Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:7d0a21caf52696488c30c66204426d875d73cc672162cf9bcbe7eb34d6cc77b2",
+      "digest": "sha256:7db7f93211cc0ea2a7dab1657474188f3040f71d568d0e41bc21b931cd28e6b5",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 93,
-      "generated_at_commit": "b46b6ba4c5f031ff1d0d8cf3ea31b5093fbd2f4f",
-      "source_tree": "sha256:33acbccec89f761fa6e71a9de3370090cdc673eabfdad525c3c9b6f997d20f69"
+      "generated_at_commit": "1fd895aef29f2163f075e7b35bb13fa2c9389192",
+      "source_tree": "sha256:96cf1e7ad952f6e5d156f1289fd580f2765997d8f2650244abb64330609a0ee1"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/scripts/ck_pi5_build_check.sh b/scripts/ck_pi5_build_check.sh
index ec1f7c3b..81715e55 100755
--- a/scripts/ck_pi5_build_check.sh
+++ b/scripts/ck_pi5_build_check.sh
@@ -37,4 +37,21 @@ done
 ps_strings="$(strings -a "${ps}")" # no early-exit pipe (SIGPIPE under pipefail)
 if grep -q "SEED-0B-PI5" <<<"${ps_strings}" && ! grep -q "SEED-0B-QEMU" <<<"${ps_strings}"; then echo "PASS pi5-store image carries the SEED-0B-PI5 tier label only"; else echo "FAIL pi5-store tier label"; fail=1; fi
 test -s "${root}/target/native-kernel-pi5-store/full-pi5-store/BOOTAA64.EFI" || { echo "FAIL no pi5-store BOOTAA64.EFI"; fail=1; }
+
+# PI5-6 cut 2: the Pi image with the inference unit linked (make pi5-infer). Model source is the boot disk
+# (MODEL.MAP) only: no fw_cfg code, and the Rust unit is present only here.
+make -C "${root}/native/kernel" pi5-infer >/dev/null
+pinf="${root}/target/native-kernel-pi5-infer/aienos-ck.elf"
+for s in aienos_infer_session_open aienos_infer_run aienos_infer_heap_init ck_infer_run ck_pi5_start ck_cpufeat_decode; do
+    if defined "${pinf}" "${s}"; then echo "PASS pi5-infer image defines ${s}"; else echo "FAIL pi5-infer image lacks ${s}"; fail=1; fi
+done
+for s in aienos_infer_session_open aienos_infer_run aienos_infer_heap_init; do
+    if defined "${pi5}" "${s}" || defined "${ps}" "${s}" || defined "${def}" "${s}"; then echo "FAIL a non-inference image defines ${s}"; fail=1; else echo "PASS plain pi5, pi5-store and default images have no ${s}"; fi
+done
+pinf_strings="$(strings -a "${pinf}")"
+if grep -q "infer_source_mode: boot-disk model" <<<"${pinf_strings}"; then echo "PASS pi5-infer image carries the boot-disk model source line"; else echo "FAIL pi5-infer boot-disk source line"; fail=1; fi
+if grep -qE "opt/aienos/model|TEST-ONLY QEMU fw_cfg|fw_cfg" <<<"${pinf_strings}"; then echo "FAIL pi5-infer image carries fw_cfg code or strings"; fail=1; else echo "PASS pi5-infer image has no fw_cfg model ingest"; fi
+if defined "${pinf}" ck_stage_store; then echo "FAIL pi5-infer image defines ck_stage_store"; fail=1; else echo "PASS pi5-infer image has no Store stage"; fi
+test -s "${root}/target/native-kernel-pi5-infer/BOOTAA64.EFI" || { echo "FAIL no pi5-infer BOOTAA64.EFI"; fail=1; }
+
 if [[ ${fail} == 0 ]]; then echo "CK_PI5_BUILD: PASS"; else echo "CK_PI5_BUILD: FAIL"; exit 1; fi