diff --git a/Kconfig.kernel b/Kconfig.kernel index 31401ef8..41cbb350 100644 --- a/Kconfig.kernel +++ b/Kconfig.kernel @@ -28,6 +28,18 @@ config STARFORTH_V4 2026-10-14: v3 is being retired. Off builds v3 alone. See docs/v4.0.0/DECOMPOSITION.md and boards/BRINGUP.md A6. +config BLK_RAM_USER_BLOCKS + int "The VM's user RAM block count (BLK_RAM_USER_BLOCKS)" + default 2048 + help + How many blocks of fast RAM a VM sees: LBN 0 .. BLK_RAM_USER_BLOCKS - 1. + The block layout is derived from it (v3/include/blk_layout.h, + block_subsystem.h: BLK_RAM_BLOCKS, BLK_DISK_START). A capsule page + `Block n` must have n at least this, and is copied down by it to be + interpreted (docs/v4.0.0/plans/2026-11-18-capsule-blocks.md). mkcapsule + and mkartemis are built with the same value. Changing it moves where + disk blocks start, so media made with another value do not match. + config PARITY_MODE bool "Deterministic parity harness mode (PARITY_MODE)" default n diff --git a/docs/v4.0.0/plans/2026-11-18-capsule-blocks.md b/docs/v4.0.0/plans/2026-11-18-capsule-blocks.md index 8b7b04e4..543c8b0f 100644 --- a/docs/v4.0.0/plans/2026-11-18-capsule-blocks.md +++ b/docs/v4.0.0/plans/2026-11-18-capsule-blocks.md @@ -79,7 +79,14 @@ Written 2026-11-18, from the capsules talk with Captain Bob. It records the ruli ## 4. The work, for ruling (nothing built) Each step is test first, then POST and the protocol: -1. **The knob.** The RAM block count becomes a Kconfig symbol. `block_subsystem.h` and the kernel read +1. **The knob. Built 2026-11-18:** + - `BLK_RAM_USER_BLOCKS` is in `Kconfig.kernel`, default 2048, defined in `v3/include/blk_layout.h`. + - `block_subsystem.h` derives `BLK_RAM_BLOCKS` (2080) and `BLK_DISK_START` from it. + - `kernel/Makefile` passes it to the kernel's C code, `mkcapsule` and `mkartemis`, and + `mkcapsule`'s two literal 2048s are the knob. + - Tested by `scripts/test_capsule_ram_blocks.sh`, 8 checks, in `logs/20261118-ram-blocks-knob/`. + + The plan as written: `block_subsystem.h` and the kernel read it, and `mkcapsule` is given it at build time in place of its literal 2048. 2. **`mkcapsule`.** - Its floor comes from the knob. diff --git a/kernel/Makefile b/kernel/Makefile index 25534e78..8e102cc3 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -67,6 +67,13 @@ $(eval $(call kconfig_bool,STARFORTH_ENABLE_VM,1)) # system=v3 (V4_DEFAULT below). STARFORTH_V4=0 builds v3 alone. $(eval $(call kconfig_bool,STARFORTH_V4,1)) +# The VM's user RAM block count, the knob the block layout is derived from (v3/include/blk_layout.h; +# docs/v4.0.0/plans/2026-11-18-capsule-blocks.md, ruling 3). The kernel gets it through +# VM_FEATURE_FLAG_VARS; mkcapsule and mkartemis are built with the same value. +$(eval $(call kconfig_int,BLK_RAM_USER_BLOCKS,2048)) +MKCAPSULE_DEFS := -DBLK_RAM_USER_BLOCKS=$(BLK_RAM_USER_BLOCKS) +MKARTEMIS_DEFS := -DBLK_RAM_USER_BLOCKS=$(BLK_RAM_USER_BLOCKS) + # Monolithic build — loader + kernel compiled together (default: enabled) MONOLITHIC ?= 1 @@ -525,7 +532,7 @@ $(eval $(call kconfig_bool,SK_PARITY_DEBUG,0)) endif VM_FEATURE_FLAG_VARS := \ - STRICT_PTR ENABLE_HOTWORDS_CACHE ENABLE_PIPELINING OPCODE_PHYSICS \ + STRICT_PTR ENABLE_HOTWORDS_CACHE ENABLE_PIPELINING OPCODE_PHYSICS BLK_RAM_USER_BLOCKS \ ROLLING_WINDOW_SIZE TRANSITION_WINDOW_SIZE \ ADAPTIVE_SHRINK_RATE ADAPTIVE_MIN_WINDOW_SIZE \ ADAPTIVE_CHECK_FREQUENCY ADAPTIVE_GROWTH_THRESHOLD \ @@ -824,12 +831,12 @@ v3/include/version.h: FORCE $(MKCAPSULE_BIN): $(MKCAPSULE_SRC) @mkdir -p $(dir $@) @echo "HOSTCC $(MKCAPSULE_SRC)" - @cc -std=c99 -Wall -Wextra -O2 -Iv3/include -Ikernel/include -Itools -o $@ $(MKCAPSULE_SRC) + @cc -std=c99 -Wall -Wextra -O2 $(MKCAPSULE_DEFS) -Iv3/include -Ikernel/include -Itools -o $@ $(MKCAPSULE_SRC) $(MKARTEMIS_BIN): $(MKARTEMIS_SRC) $(wildcard v3/include/*.h) kernel/include/starkernel/artemis_sig.h @mkdir -p $(dir $@) @echo "HOSTCC tools/mkartemis.c" - @cc -std=gnu99 -Wall -O2 -Iv3/include -Ikernel/include -o $@ $(MKARTEMIS_SRC) + @cc -std=gnu99 -Wall -O2 $(MKARTEMIS_DEFS) -Iv3/include -Ikernel/include -o $@ $(MKARTEMIS_SRC) # datastick -- the data stick, fresh every time it is made (STICK.md 9: "fresh for each boot"). .PHONY: datastick diff --git a/logs/20261118-ram-blocks-knob/build-amd64.log b/logs/20261118-ram-blocks-knob/build-amd64.log new file mode 100644 index 00000000..eac61f0b --- /dev/null +++ b/logs/20261118-ram-blocks-knob/build-amd64.log @@ -0,0 +1,263 @@ +HOSTCC tools/mkcapsule.c tools/pkcs8_ed25519.c kernel/src/crypto/ed25519.c kernel/src/crypto/fe25519.c kernel/src/crypto/scalar25519.c kernel/src/crypto/sha512.c kernel/src/crypto/x509_ed25519.c + V4ROM capsules/v4/rom -> build/amd64/kernel/v4_rom_64.c build/amd64/kernel/v4_map_64.c build/amd64/kernel/v4_mesh_rom_64.c +CC (kernel) v3/src/block_subsystem.c +CC (kernel) v3/src/blkio_ram.c +CC (kernel) v3/src/compudynamics.c +CC (kernel) v3/src/dictionary_heat_optimization.c +CC (kernel) v3/src/dictionary_management.c +CC (kernel) v3/src/heartbeat_export.c +CC (kernel) v3/src/inference_engine.c +CC (kernel) v3/src/io.c +CC (kernel) v3/src/math_portable.c +CC (kernel) v3/src/memory_management.c +CC (kernel) v3/src/physics_execution_hooks.c +CC (kernel) v3/src/physics_hotwords_cache.c +CC (kernel) v3/src/physics_metadata.c +CC (kernel) v3/src/physics_pipelining_metrics.c +CC (kernel) v3/src/physics_runtime.c +CC (kernel) v3/src/profiler.c +CC (kernel) v3/src/rolling_window_of_truth.c +CC (kernel) v3/src/ssm_jacquard.c +CC (kernel) v3/src/stack_management.c +CC (kernel) v3/src/vm_api.c +CC (kernel) v3/src/vm_debug.c +CC (kernel) v3/src/word_registry.c +CC (kernel) v3/src/word_source/acl_words.c +CC (kernel) v3/src/word_source/arithmetic_words.c +CC (kernel) v3/src/word_source/block_words.c +CC (kernel) v3/src/word_source/control_words.c +CC (kernel) v3/src/word_source/defer_words.c +CC (kernel) v3/src/word_source/defining_words.c +CC (kernel) v3/src/word_source/dictionary_heat_diagnostic_words.c +CC (kernel) v3/src/word_source/dictionary_manipulation_words.c +CC (kernel) v3/src/word_source/dictionary_words.c +CC (kernel) v3/src/word_source/double_words.c +CC (kernel) v3/src/word_source/editor_words.c +CC (kernel) v3/src/word_source/format_words.c +CC (kernel) v3/src/word_source/framebuffer_words.c +CC (kernel) v3/src/word_source/inference_words.c +CC (kernel) v3/src/word_source/io_words.c +CC (kernel) v3/src/word_source/keyboard_words.c +CC (kernel) v3/src/word_source/lifecycle_words_hosted.c +CC (kernel) v3/src/word_source/log_words.c +CC (kernel) v3/src/word_source/logical_words.c +CC (kernel) v3/src/word_source/memory_words.c +CC (kernel) v3/src/word_source/mixed_arithmetic_words.c +CC (kernel) v3/src/word_source/physics_benchmark_words.c +CC (kernel) v3/src/word_source/physics_diagnostic_words.c +CC (kernel) v3/src/word_source/physics_freeze_words.c +CC (kernel) v3/src/word_source/physics_pipelining_diagnostic_words.c +CC (kernel) v3/src/word_source/q48_words.c +CC (kernel) v3/src/word_source/return_stack_words.c +CC (kernel) v3/src/word_source/scroll_words.c +CC (kernel) v3/src/word_source/stack_words.c +CC (kernel) v3/src/word_source/starforth_words.c +CC (kernel) v3/src/word_source/string_words.c +CC (kernel) v3/src/word_source/system_words.c +CC (kernel) v3/src/word_source/ttf_words.c +CC (kernel) v3/src/word_source/vocabulary_words.c +CC (kernel) v3/src/test_runner/test_common.c +CC (kernel) v3/src/test_runner/test_contracts.c +CC (kernel) v3/src/test_runner/test_runner.c +CC (kernel) v3/src/test_runner/modules/acl_words_test.c +CC (kernel) v3/src/test_runner/modules/arithmetic_words_test.c +CC (kernel) v3/src/test_runner/modules/block_words_test.c +CC (kernel) v3/src/test_runner/modules/control_words_test.c +CC (kernel) v3/src/test_runner/modules/defining_words_tests.c +CC (kernel) v3/src/test_runner/modules/dictionary_manipulation_words_test.c +CC (kernel) v3/src/test_runner/modules/dictionary_words_test.c +CC (kernel) v3/src/test_runner/modules/double_words_test.c +CC (kernel) v3/src/test_runner/modules/format_words_test.c +CC (kernel) v3/src/test_runner/modules/inference_words_test.c +CC (kernel) v3/src/test_runner/modules/integration_tests.c +CC (kernel) v3/src/test_runner/modules/io_words_test.c +CC (kernel) v3/src/test_runner/modules/logical_words_test.c +CC (kernel) v3/src/test_runner/modules/mama_forth_words_test.c +CC (kernel) v3/src/test_runner/modules/memory_words_test.c +CC (kernel) v3/src/test_runner/modules/mixed_arithmetic_words_test.c +CC (kernel) v3/src/test_runner/modules/physics_freeze_words_test.c +CC (kernel) v3/src/test_runner/modules/q48_words_test.c +CC (kernel) v3/src/test_runner/modules/return_stack_words_test.c +CC (kernel) v3/src/test_runner/modules/stack_words_test.c +CC (kernel) v3/src/test_runner/modules/starforth_words_test.c +CC (kernel) v3/src/test_runner/modules/stress_tests.c +CC (kernel) v3/src/test_runner/modules/string_words_test.c +CC (kernel) v3/src/test_runner/modules/system_words_test.c +CC (kernel) v3/src/test_runner/modules/vocabulary_words_test.c + MKCAP capsules -> build/amd64/kernel/capsule_generated.c +mkcapsule: checking for block conflicts... +CC (loader) v3/src/blkio_ram.c +mkcapsule: scanning capsules + [p] zuse.4th (1684 bytes, hash=0x490ded9be257a90b) + [p] font.4th (17688 bytes, hash=0x3f305911500c78f6) + [p] MANIFEST_AUTO.md (11687 bytes, hash=0xe022545a0755960f) + [p] multiuser-doe.4th (3942 bytes, hash=0x22140588ee7c39e6) + [p] hestia:init.4th (891 bytes, hash=0x64e111990fbc45ff) + [p] contrib:README.md (1855 bytes, hash=0x4212e52b927793e7) + [p] ACL.4th (4318 bytes, hash=0xf8890c05c0d8f921) + [p] workload-3.4th (2189 bytes, hash=0x62b7a71576ad1041) + [p] init-l8-diverse.4th (430 bytes, hash=0xaa293201a6c91838) + [p] user-font-demo.4th (1674 bytes, hash=0xce1fd7d1b581a56d) + [p] workload-9.4th (1321 bytes, hash=0x3f2bec73142aa424) + [p] lib.4th (619 bytes, hash=0x4b216635c359ef73) + [p] workload-calib1.4th (304 bytes, hash=0x3b9f2d17b554fabc) + [m] init.4th (669 bytes, hash=0xd09db9461b336431) + [p] workload-1-lite.4th (540 bytes, hash=0x44a7a7e3176dcc8d) + [p] init-l8-stable.4th (278 bytes, hash=0xdc3830f189063a9a) + [p] v4:physics.4th (2937 bytes, hash=0x747d89ca8d57e29c) + [p] v4:forth79.4th (1208 bytes, hash=0x4055641ee17d176b) + [p] v4:sys:log.f18 (4535 bytes, hash=0x544cd004233dff62) + [p] v4:sys:qmath.f18 (8607 bytes, hash=0xa93783c2c8f9b7db) + [p] v4:sys:map-32.f18 (3162 bytes, hash=0x5bdf8cbbebdd3c8f) + [p] v4:sys:blocks.f18 (6112 bytes, hash=0x09d361dbe6174236) + [p] v4:sys:input.f18 (10692 bytes, hash=0x0f13c3f9d5fd07fc) + [p] v4:sys:dict.f18 (13816 bytes, hash=0xe3453808afd5a0af) + [p] v4:sys:forth.f18 (12617 bytes, hash=0xc4c0ad315c95eda4) + [p] v4:sys:quit.f18 (32141 bytes, hash=0x7fa7a7668b6bf1ed) + [p] v4:sys:map-64.f18 (3201 bytes, hash=0x06cb44832df2b8fd) + [p] v4:sys:codegen.f18 (4999 bytes, hash=0x36d2ae84d2911b90) + [p] v4:sys:acl.f18 (4100 bytes, hash=0x76e7e746befa2733) + [p] v4:sys:core.f18 (24370 bytes, hash=0x0f415502fccc3fba) +CC (loader) v3/src/block_subsystem.c + [p] v4:sys:system.f18 (10189 bytes, hash=0xfe257eb084c43a5d) + [p] v4:sys:numout.f18 (6641 bytes, hash=0xca0fb0f9c1589e20) + [p] v4:sys:words.f18 (9642 bytes, hash=0x2f4e5f7f3e7f736f) +CC (loader) v3/src/compudynamics.c + [p] v4:sys:compile.f18 (23099 bytes, hash=0xb46bf77ceee7245a) + [p] v4:sys:end.f18 (1452 bytes, hash=0x98fd33b1c431cfe7) + [p] v4:starshipos.4th (702 bytes, hash=0x5658ee1b771b5963) + [p] v4:hera.4th (1372 bytes, hash=0x85300ad4e6e8b86b) + [p] v4:rom:sym.f18 (5610 bytes, hash=0xbbad5748f5bbf863) + [p] v4:rom:main.f18 (2284 bytes, hash=0x6994f1f1d567e163) + [p] v4:rom:math.f18 (5108 bytes, hash=0x9be63ad87934622f) + [p] v4:rom:dir.f18 (5112 bytes, hash=0x51b069f0623ded16) + [p] v4:rom:num.f18 (2634 bytes, hash=0x08b76f1b058cac17) + [p] v4:rom:pack.f18 (4583 bytes, hash=0x65a944d8eb7de7f2) + [p] v4:rom:word.f18 (12966 bytes, hash=0x9210d6c2ac424d11) + [p] v4:rom:in.f18 (4230 bytes, hash=0x65798bed38a09f0f) + [p] v4:rom:mesh.f18 (449 bytes, hash=0x83723d76b9620c2c) + [p] v4:centre.4th (3899 bytes, hash=0xccd1b28a101c78b2) + [p] README.md (2305 bytes, hash=0x09a684ebdfbeb01c) + [p] block-acl.4th (980 bytes, hash=0xf6cc2a59e3a6734e) + [p] sdk.4th (2295 bytes, hash=0x008fdbbb62c94a3a) + [p] pki:starshipos-intermediate.der (408 bytes, hash=0xb40aab540c19f877) + [p] init-l8-omni.4th (1986 bytes, hash=0x5979e314d6452045) + [p] acl-std79.4th (5040 bytes, hash=0x773bf9209df191d1) + [p] doe-campaign.4th (2369 bytes, hash=0x26fb485e5c9dc6ff) + [p] init-l8-volatile.4th (718 bytes, hash=0x98caabbbd92abac4) + [p] doe.4th (3244 bytes, hash=0xf154616d248e861f) + [p] fabric.4th (10359 bytes, hash=0x9d9489cbeca4099b) + [p] workload-4.4th (469 bytes, hash=0x099619264e650b1c) + [p] init-l8-temporal.4th (363 bytes, hash=0x51abd4c138246651) + [p] workload-5.4th (480 bytes, hash=0x526964c7c9506a11) + [p] fonts:README.md (1846 bytes, hash=0xf628c2b7a49f4d46) + [p] fonts:JetBrainsMono-Regular.ttf (270224 bytes, hash=0xf4b7077dab274e6b) + [p] init-l8-transition.4th (529 bytes, hash=0xbcc1a81976f0a4c9) + [p] workload-2.4th (1321 bytes, hash=0xf113b3d0bcccae47) + [p] workload-1.4th (1041 bytes, hash=0x63e251adb0a03613) + [p] workload-5-lite.4th (468 bytes, hash=0xea0303f38824f254) + [p] workload-0.4th (290 bytes, hash=0x93f86f60aeba8feb) + [p] artemis:init.4th (16782 bytes, hash=0x7ba120e2a6aab239) + [p] MANIFEST.md (35813 bytes, hash=0x9d3a6fdb7415d224) + [p] workload-7.4th (206 bytes, hash=0x02862291387eb7ac) + [p] BLOCK_MAP.md (22910 bytes, hash=0xd11c185372228b0c) + [p] turtle.4th (3254 bytes, hash=0x4d470418ca543365) + [p] workload-8.4th (172 bytes, hash=0x56b7f2f0efa000df) + [p] workload-6.4th (1986 bytes, hash=0x06fc0ce1e369ef5a) +mkcapsule: 74 capsule(s) collected +CC (loader) v3/src/dictionary_heat_optimization.c +mkcapsule: wrote build/amd64/kernel/capsule_generated.c + MKCAP capsules -> capsules/BLOCK_MAP.md +mkcapsule: manifest written to capsules/BLOCK_MAP.md (40 capsule(s)) +CC (loader) v3/src/dictionary_management.c +CC (loader) v3/src/heartbeat_export.c +CC (loader) v3/src/inference_engine.c +CC (loader) v3/src/io.c +CC (loader) v3/src/math_portable.c +CC (loader) v3/src/memory_management.c +CC (loader) v3/src/physics_execution_hooks.c +CC (loader) v3/src/physics_hotwords_cache.c +CC (loader) v3/src/physics_metadata.c +CC (loader) v3/src/physics_pipelining_metrics.c +CC (loader) v3/src/physics_runtime.c +CC (loader) v3/src/profiler.c +CC (loader) v3/src/rolling_window_of_truth.c +CC (loader) v3/src/ssm_jacquard.c +CC (loader) v3/src/stack_management.c +CC (loader) v3/src/vm_api.c +CC (loader) v3/src/vm_debug.c +CC (loader) v3/src/word_registry.c +CC (loader) v3/src/word_source/acl_words.c +CC (loader) v3/src/word_source/arithmetic_words.c +CC (loader) v3/src/word_source/block_words.c +CC (loader) v3/src/word_source/control_words.c +CC (loader) v3/src/word_source/defer_words.c +CC (loader) v3/src/word_source/defining_words.c +CC (loader) v3/src/word_source/dictionary_heat_diagnostic_words.c +CC (loader) v3/src/word_source/dictionary_manipulation_words.c +CC (loader) v3/src/word_source/dictionary_words.c +CC (loader) v3/src/word_source/double_words.c +CC (loader) v3/src/word_source/editor_words.c +CC (loader) v3/src/word_source/format_words.c +CC (loader) v3/src/word_source/framebuffer_words.c +CC (loader) v3/src/word_source/inference_words.c +CC (loader) v3/src/word_source/io_words.c +CC (loader) v3/src/word_source/keyboard_words.c +CC (loader) v3/src/word_source/lifecycle_words_hosted.c +CC (loader) v3/src/word_source/log_words.c +CC (loader) v3/src/word_source/logical_words.c +CC (loader) v3/src/word_source/memory_words.c +CC (loader) v3/src/word_source/mixed_arithmetic_words.c +CC (loader) v3/src/word_source/physics_benchmark_words.c +CC (loader) v3/src/word_source/physics_diagnostic_words.c +CC (loader) v3/src/word_source/physics_freeze_words.c +CC (loader) v3/src/word_source/physics_pipelining_diagnostic_words.c +CC (loader) v3/src/word_source/q48_words.c +CC (loader) v3/src/word_source/return_stack_words.c +CC (loader) v3/src/word_source/scroll_words.c +CC (loader) v3/src/word_source/stack_words.c +CC (loader) v3/src/word_source/starforth_words.c +CC (loader) v3/src/word_source/string_words.c +CC (loader) v3/src/word_source/system_words.c +CC (loader) v3/src/word_source/ttf_words.c +CC (loader) v3/src/word_source/vocabulary_words.c +CC (loader) v3/src/test_runner/test_common.c +CC (loader) v3/src/test_runner/test_contracts.c +CC (loader) v3/src/test_runner/test_runner.c +CC (loader) v3/src/test_runner/modules/acl_words_test.c +CC (loader) v3/src/test_runner/modules/arithmetic_words_test.c +CC (loader) v3/src/test_runner/modules/block_words_test.c +CC (loader) v3/src/test_runner/modules/control_words_test.c +CC (loader) v3/src/test_runner/modules/defining_words_tests.c +CC (loader) v3/src/test_runner/modules/dictionary_manipulation_words_test.c +CC (loader) v3/src/test_runner/modules/dictionary_words_test.c +CC (loader) v3/src/test_runner/modules/double_words_test.c +CC (loader) v3/src/test_runner/modules/format_words_test.c +CC (loader) v3/src/test_runner/modules/inference_words_test.c +CC (loader) v3/src/test_runner/modules/integration_tests.c +CC (loader) v3/src/test_runner/modules/io_words_test.c +CC (loader) v3/src/test_runner/modules/logical_words_test.c +CC (loader) v3/src/test_runner/modules/mama_forth_words_test.c +CC (loader) v3/src/test_runner/modules/memory_words_test.c +CC (loader) v3/src/test_runner/modules/mixed_arithmetic_words_test.c +CC (loader) v3/src/test_runner/modules/physics_freeze_words_test.c +CC (loader) v3/src/test_runner/modules/q48_words_test.c +CC (loader) v3/src/test_runner/modules/return_stack_words_test.c +CC (loader) v3/src/test_runner/modules/stack_words_test.c +CC (loader) v3/src/test_runner/modules/starforth_words_test.c +CC (loader) v3/src/test_runner/modules/string_words_test.c +CC (loader) v3/src/test_runner/modules/stress_tests.c +CC (loader) v3/src/test_runner/modules/system_words_test.c +CC (loader) v3/src/test_runner/modules/vocabulary_words_test.c + CC build/amd64/kernel/capsule_generated.c + CC (kernel) build/amd64/kernel/capsule_generated.c +LD (kernel) build/amd64/kernel/starkernel_kernel.elf +ld: warning: build/amd64/kernel/obj/kernel/arch/amd64/switch.o: missing .note.GNU-stack section implies executable stack +ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker +Kernel built: build/amd64/kernel/starkernel_kernel.elf +LD (loader PE) build/amd64/kernel/starkernel_loader.efi +Loader built: build/amd64/kernel/starkernel_loader.efi +StarKernel built successfully for amd64 + Loader: build/amd64/kernel/starkernel_loader.efi + Kernel: build/amd64/kernel/starkernel_kernel.elf +rc=0 diff --git a/logs/20261118-ram-blocks-knob/host-tests.log b/logs/20261118-ram-blocks-knob/host-tests.log new file mode 100644 index 00000000..8b15855b --- /dev/null +++ b/logs/20261118-ram-blocks-knob/host-tests.log @@ -0,0 +1,3 @@ + 48 checks, 0 failures + 1360 checks, 0 failures + 126 checks, 0 failures diff --git a/logs/20261118-ram-blocks-knob/lint.log b/logs/20261118-ram-blocks-knob/lint.log new file mode 100644 index 00000000..daaaa3e8 --- /dev/null +++ b/logs/20261118-ram-blocks-knob/lint.log @@ -0,0 +1 @@ +mkcapsule lint: 40 file(s), 0 failing, 0 violation(s) [ALL PASS] diff --git a/logs/20261118-ram-blocks-knob/mesh-boot.log b/logs/20261118-ram-blocks-knob/mesh-boot.log new file mode 100644 index 00000000..f3dd7912 --- /dev/null +++ b/logs/20261118-ram-blocks-knob/mesh-boot.log @@ -0,0 +1,82 @@ +mkcapsule: checking for block conflicts... +mkcapsule: scanning /home/user/LithosAnanke/capsules + [p] zuse.4th (1684 bytes, hash=0x490ded9be257a90b) + [p] font.4th (17688 bytes, hash=0x3f305911500c78f6) + [p] MANIFEST_AUTO.md (11687 bytes, hash=0xe022545a0755960f) + [p] multiuser-doe.4th (3942 bytes, hash=0x22140588ee7c39e6) + [p] hestia:init.4th (891 bytes, hash=0x64e111990fbc45ff) + [p] contrib:README.md (1855 bytes, hash=0x4212e52b927793e7) + [p] ACL.4th (4318 bytes, hash=0xf8890c05c0d8f921) + [p] workload-3.4th (2189 bytes, hash=0x62b7a71576ad1041) + [p] init-l8-diverse.4th (430 bytes, hash=0xaa293201a6c91838) + [p] user-font-demo.4th (1674 bytes, hash=0xce1fd7d1b581a56d) + [p] workload-9.4th (1321 bytes, hash=0x3f2bec73142aa424) + [p] lib.4th (619 bytes, hash=0x4b216635c359ef73) + [p] workload-calib1.4th (304 bytes, hash=0x3b9f2d17b554fabc) + [m] init.4th (669 bytes, hash=0xd09db9461b336431) + [p] workload-1-lite.4th (540 bytes, hash=0x44a7a7e3176dcc8d) + [p] init-l8-stable.4th (278 bytes, hash=0xdc3830f189063a9a) + [p] v4:physics.4th (2937 bytes, hash=0x747d89ca8d57e29c) + [p] v4:forth79.4th (1208 bytes, hash=0x4055641ee17d176b) + [p] v4:sys:log.f18 (4535 bytes, hash=0x544cd004233dff62) + [p] v4:sys:qmath.f18 (8607 bytes, hash=0xa93783c2c8f9b7db) + [p] v4:sys:map-32.f18 (3162 bytes, hash=0x5bdf8cbbebdd3c8f) + [p] v4:sys:blocks.f18 (6112 bytes, hash=0x09d361dbe6174236) + [p] v4:sys:input.f18 (10692 bytes, hash=0x0f13c3f9d5fd07fc) + [p] v4:sys:dict.f18 (13816 bytes, hash=0xe3453808afd5a0af) + [p] v4:sys:forth.f18 (12617 bytes, hash=0xc4c0ad315c95eda4) + [p] v4:sys:quit.f18 (32141 bytes, hash=0x7fa7a7668b6bf1ed) + [p] v4:sys:map-64.f18 (3201 bytes, hash=0x06cb44832df2b8fd) + [p] v4:sys:codegen.f18 (4999 bytes, hash=0x36d2ae84d2911b90) + [p] v4:sys:acl.f18 (4100 bytes, hash=0x76e7e746befa2733) + [p] v4:sys:core.f18 (24370 bytes, hash=0x0f415502fccc3fba) + [p] v4:sys:system.f18 (10189 bytes, hash=0xfe257eb084c43a5d) + [p] v4:sys:numout.f18 (6641 bytes, hash=0xca0fb0f9c1589e20) + [p] v4:sys:words.f18 (9642 bytes, hash=0x2f4e5f7f3e7f736f) + [p] v4:sys:compile.f18 (23099 bytes, hash=0xb46bf77ceee7245a) + [p] v4:sys:end.f18 (1452 bytes, hash=0x98fd33b1c431cfe7) + [p] v4:starshipos.4th (702 bytes, hash=0x5658ee1b771b5963) + [p] v4:hera.4th (1372 bytes, hash=0x85300ad4e6e8b86b) + [p] v4:rom:sym.f18 (5610 bytes, hash=0xbbad5748f5bbf863) + [p] v4:rom:main.f18 (2284 bytes, hash=0x6994f1f1d567e163) + [p] v4:rom:math.f18 (5108 bytes, hash=0x9be63ad87934622f) + [p] v4:rom:dir.f18 (5112 bytes, hash=0x51b069f0623ded16) + [p] v4:rom:num.f18 (2634 bytes, hash=0x08b76f1b058cac17) + [p] v4:rom:pack.f18 (4583 bytes, hash=0x65a944d8eb7de7f2) + [p] v4:rom:word.f18 (12966 bytes, hash=0x9210d6c2ac424d11) + [p] v4:rom:in.f18 (4230 bytes, hash=0x65798bed38a09f0f) + [p] v4:rom:mesh.f18 (449 bytes, hash=0x83723d76b9620c2c) + [p] v4:centre.4th (3899 bytes, hash=0xccd1b28a101c78b2) + [p] README.md (2305 bytes, hash=0x09a684ebdfbeb01c) + [p] block-acl.4th (980 bytes, hash=0xf6cc2a59e3a6734e) + [p] sdk.4th (2295 bytes, hash=0x008fdbbb62c94a3a) + [p] pki:starshipos-intermediate.der (408 bytes, hash=0xb40aab540c19f877) + [p] init-l8-omni.4th (1986 bytes, hash=0x5979e314d6452045) + [p] acl-std79.4th (5040 bytes, hash=0x773bf9209df191d1) + [p] doe-campaign.4th (2369 bytes, hash=0x26fb485e5c9dc6ff) + [p] init-l8-volatile.4th (718 bytes, hash=0x98caabbbd92abac4) + [p] doe.4th (3244 bytes, hash=0xf154616d248e861f) + [p] fabric.4th (10359 bytes, hash=0x9d9489cbeca4099b) + [p] workload-4.4th (469 bytes, hash=0x099619264e650b1c) + [p] init-l8-temporal.4th (363 bytes, hash=0x51abd4c138246651) + [p] workload-5.4th (480 bytes, hash=0x526964c7c9506a11) + [p] fonts:README.md (1846 bytes, hash=0xf628c2b7a49f4d46) + [p] fonts:JetBrainsMono-Regular.ttf (270224 bytes, hash=0xf4b7077dab274e6b) + [p] init-l8-transition.4th (529 bytes, hash=0xbcc1a81976f0a4c9) + [p] workload-2.4th (1321 bytes, hash=0xf113b3d0bcccae47) + [p] workload-1.4th (1041 bytes, hash=0x63e251adb0a03613) + [p] workload-5-lite.4th (468 bytes, hash=0xea0303f38824f254) + [p] workload-0.4th (290 bytes, hash=0x93f86f60aeba8feb) + [p] artemis:init.4th (16782 bytes, hash=0x7ba120e2a6aab239) + [p] MANIFEST.md (35813 bytes, hash=0x9d3a6fdb7415d224) + [p] workload-7.4th (206 bytes, hash=0x02862291387eb7ac) + [p] BLOCK_MAP.md (22910 bytes, hash=0xd11c185372228b0c) + [p] turtle.4th (3254 bytes, hash=0x4d470418ca543365) + [p] workload-8.4th (172 bytes, hash=0x56b7f2f0efa000df) + [p] workload-6.4th (1986 bytes, hash=0x06fc0ce1e369ef5a) +mkcapsule: 74 capsule(s) collected +mkcapsule: wrote /home/user/LithosAnanke/v4/build/capsule_generated.c + [mesh boot, V4_CELL_BITS=64] +v4 mesh boot: V4_CELL_BITS=64 + PARITY:V4_POST tests=990 pass=990 fail=0 + 109 checks, 0 failures diff --git a/logs/20261118-ram-blocks-knob/test-32.log b/logs/20261118-ram-blocks-knob/test-32.log new file mode 100644 index 00000000..08db5edc --- /dev/null +++ b/logs/20261118-ram-blocks-knob/test-32.log @@ -0,0 +1,272 @@ + [V4_CELL_BITS=32 run-32-test_asm.c] +v4 asm tests: V4_CELL_BITS=32 + 32 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_cells.c] +v4 single-cell word tests: V4_CELL_BITS=32 + code: 99 of 1024 words + NIP headroom: data 7 below canary, return 7 below its return address + SWAP headroom: data 6 below canary, return 6 below its return address + ROT headroom: data 5 below canary, return 4 below its return address + -ROT headroom: data 5 below canary, return 5 below its return address + ?DUP headroom: data 7 below canary, return 8 below its return address + +! headroom: data 7 below canary, return 8 below its return address + -! headroom: data 7 below canary, return 8 below its return address + 2@ headroom: data 7 below canary, return 8 below its return address + 2! headroom: data 6 below canary, return 6 below its return address + - headroom: data 6 below canary, return 8 below its return address + MIN headroom: data 3 below canary, return 6 below its return address + MAX headroom: data 3 below canary, return 6 below its return address + OR headroom: data 6 below canary, return 8 below its return address + 0> headroom: data 8 below canary, return 8 below its return address + <> headroom: data 7 below canary, return 8 below its return address + < headroom: data 5 below canary, return 7 below its return address + > headroom: data 5 below canary, return 6 below its return address + <= headroom: data 5 below canary, return 6 below its return address + >= headroom: data 5 below canary, return 6 below its return address + U< headroom: data 5 below canary, return 7 below its return address + WITHIN headroom: data 3 below canary, return 5 below its return address + 21420 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_console.c] +v4 console tests: V4_CELL_BITS=32, capture 4096 characters + 312 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_dump.c] +test_dump: 15 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_exec.c] +v4 exec tests: V4_CELL_BITS=32 + 3107 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_fabric.c] +v4 fabric tests: V4_CELL_BITS=32, 8 ports to a node + 334 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_fabric_walk.c] +v4 fabric walk tests + 13 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_foundation.c] +v4 foundation tests: V4_CELL_BITS=32 + code: 949 of 1024 words + Q.+ random cases that overflow Q48.16: 2682 of 20000 + Q.> as written (SWAP D<): 11702 wrong of 20169 + (UQ/) cases run: 8687 + UM* headroom: data 5 below canary, return 6 below its return address + UM/MOD headroom: data 5 below canary, return 6 below its return address + ABS headroom: data 7 below canary, return 7 below its return address + U> headroom: data 5 below canary, return 5 below its return address + D+ headroom: data 5 below canary, return 5 below its return address + DNEGATE headroom: data 6 below canary, return 7 below its return address + DABS headroom: data 6 below canary, return 6 below its return address + M+ headroom: data 5 below canary, return 4 below its return address + M- headroom: data 4 below canary, return 5 below its return address + M* headroom: data 5 below canary, return 4 below its return address + M/MOD headroom: data 4 below canary, return 3 below its return address + MOD headroom: data 4 below canary, return 2 below its return address + */MOD headroom: data 4 below canary, return 2 below its return address + */ headroom: data 4 below canary, return 2 below its return address + D0< headroom: data 7 below canary, return 7 below its return address + D2* headroom: data 6 below canary, return 7 below its return address + D2/ headroom: data 7 below canary, return 7 below its return address + 2ROT headroom: data 2 below canary, return 1 below its return address + D- headroom: data 4 below canary, return 4 below its return address + D0= headroom: data 6 below canary, return 7 below its return address + D= headroom: data 4 below canary, return 3 below its return address + < headroom: data 5 below canary, return 7 below its return address + = headroom: data 7 below canary, return 7 below its return address + D< headroom: data 3 below canary, return 3 below its return address + (D<) headroom: data 2 below canary, return 5 below its return address + 2SWAP headroom: data 4 below canary, return 4 below its return address + 2OVER headroom: data 2 below canary, return 3 below its return address + DMAX headroom: data 2 below canary, return 4 below its return address + DMIN headroom: data 2 below canary, return 4 below its return address + Q.> (2SWAP D<) headroom: data 3 below canary, return 2 below its return address + Q.* headroom: data 2 below canary, return 3 below its return address + (UQ/) headroom: data 3 below canary, return 4 below its return address + Q./ headroom: data 2 below canary, return 3 below its return address + Q.EXP headroom: data 2 below canary, return 2 below its return address + Q.SQRT headroom: data 2 below canary, return 2 below its return address + Q.LOG headroom: data 2 below canary, return 2 below its return address + (Q.REDUCE) headroom: data 4 below canary, return 5 below its return address + Q.SIN headroom: data 2 below canary, return 2 below its return address + Q.COS headroom: data 2 below canary, return 2 below its return address + LSHIFT headroom: data 6 below canary, return 5 below its return address + RSHIFT headroom: data 6 below canary, return 5 below its return address + C@ headroom: data 7 below canary, return 7 below its return address + C! headroom: data 6 below canary, return 7 below its return address + SM/REM headroom: data 4 below canary, return 3 below its return address + /MOD headroom: data 4 below canary, return 2 below its return address + / headroom: data 4 below canary, return 2 below its return address + * headroom: data 5 below canary, return 5 below its return address + 1023754 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_guard.c] +v4 guard tests: V4_CELL_BITS=32, data bound 1, return bound 1 + 60 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_heat.c] +v4 heat tests: V4_CELL_BITS=32 + 67 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_blocks.c] +v4 block request tests: V4_CELL_BITS=32, V4_NODE_WORDS=32768 + 46 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_codegen.c] +v4 host code generator tests: V4_CELL_BITS=32, V4_NODE_WORDS=32768 + code: 1728 words + 856 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_compile.c] +v4 host compiler tests: V4_CELL_BITS=32, V4_NODE_WORDS=32768 + capsule: 4559 words + a line may have 270 values on the stack while the interpreter reads its next word + a word run from the interpreter has 29 return entries to itself + defining and running a word leaves 1017 data cells under it untouched + 1096 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_depth.c] +v4 mesh depth tests: V4_CELL_BITS=32, V4_NODE_WORDS=32768 + a text that prints 1012..1024 values: works to 1020, then a stack error and nothing else; calls: works to 23 deep; 19 worked, 14 clean errors, 0 failures + SEND 1012..1024 values: works to 1018, then a stack error and nothing else; calls: works to 26 deep; 20 worked, 13 clean errors, 0 failures + SEND with no way 1012..1024 values: works to 1018, then a stack error and nothing else; calls: works to 27 deep; 21 worked, 12 clean errors, 0 failures + AWAIT answered 1012..1024 values: works to 1018, then a stack error and nothing else; calls: works to 24 deep; 18 worked, 15 clean errors, 0 failures + AWAIT ended by a GONE 1012..1024 values: works to 1018, then a stack error and nothing else; calls: works to 24 deep; 18 worked, 15 clean errors, 0 failures + passing on while its text waits for room 1012..1024 values: works to 1018, then a stack error and nothing else; calls: works to 17 deep; 11 worked, 22 clean errors, 0 failures + AWAIT broken by a line from the console 1012..1024 values: works to 1018, then a stack error and nothing else; calls: works to 24 deep; 18 worked, 15 clean errors, 0 failures + a refusal while its text waits for room 1012..1024 values: works to 1018, then a stack error and nothing else; calls: works to 17 deep; 11 worked, 22 clean errors, 0 failures + GONE 1012..1024 values: works to 1019, then a stack error and nothing else; calls: works to 26 deep; 21 worked, 12 clean errors, 0 failures + a spent message refused while its text waits 1012..1024 values: works to 1018, then a stack error and nothing else; calls: works to 17 deep; 11 worked, 22 clean errors, 0 failures + 330 runs: 168 worked, 162 ended in a stack error and nothing else, 0 did neither + 397 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_dict.c] +v4 host dictionary tests: V4_CELL_BITS=32, V4_NODE_WORDS=32768 + code: 1633 words + 300 entries in 2218 cells + FIND headroom: data 1020 below canary, return 28 below its return address + (') headroom: data 1020 below canary, return 28 below its return address + MAKE headroom: data 1020 below canary, return 28 below its return address + , headroom: data 1020 below canary, return 31 below its return address + ALLOT headroom: data 1020 below canary, return 30 below its return address + 708 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_input.c] +v4 host input tests: V4_CELL_BITS=32, V4_NODE_WORDS=32768 + code: 1108 words + WORD headroom: data 1020 below canary, return 29 below its return address + NUMBER headroom: data 1016 below canary, return 25 below its return address + EXPECT headroom: data 1020 below canary, return 30 below its return address + ENCLOSE headroom: data 1017 below canary, return 28 below its return address + 6569 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_mesh.c] +v4 mesh tests: V4_CELL_BITS=32, V4_NODE_WORDS=32768 + the flood: 268 sends tried: 2 refused at once, 121 let go on the way, 145 done; 1 of the two texts that set a node sending let go; (LOST) 122, (REFUSED) 124 + between texts the nucleus used at most 3 cells of the data stack and 4 entries of the return stack + a node removed or a wire cut: 19983 times in all + 244 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_node.c] +v4 host node tests: V4_CELL_BITS=32, V4_NODE_WORDS=32768 + 45 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_quit.c] +v4 host prompt tests: V4_CELL_BITS=32, V4_NODE_WORDS=32768 + capsule: 7381 words + from the prompt, words may call each other 30 deep + 1020 values may wait on the stack while the next line is typed and interpreted + defining and running a word from the prompt leaves 1017 data cells under it untouched + .S prints a stack of up to 1018 values; it needs 6 cells free + WORDS: 318 names, longest line 74 columns + 1356 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_rom_asm.c] +test_host_rom_asm: 466 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_rom_in.c] +test_host_rom_in: 26 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_rom_math.c] +v4 ROM math tests: V4_CELL_BITS=32 + the host ROM: 2383 words; the mesh ROM: 265 words + 156 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_rom_nucleus.c] + the ROM assembled the system: 63401381 instructions, 16536684 instruction words, 0.76 s (32-bit cells) +test_host_rom_nucleus: 6 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_rom_num.c] +test_host_rom_num: 31 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_rom_pack.c] +test_host_rom_pack: 7 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_rom_range.c] +test_host_rom_range: 19 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_rom_sym.c] +test_host_rom_sym: 81 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_host_unit.c] +v4 unit tests: V4_CELL_BITS=32, V4_NODE_WORDS=32768 + not run at this width: the capsules are the 64-bit products' + [V4_CELL_BITS=32 run-32-test_iword.c] +v4 iword tests: V4_CELL_BITS=32 + 1763 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_loops.c] +v4 loop tests: V4_CELL_BITS=32 + code: 298 of 1024 words + loops run against C: 3008 (1696 more would run past 63 times and were left out) + DO .. LOOP headroom: data 5 below canary, return 6 below its return address + DO .. +LOOP headroom: data 5 below canary, return 6 below its return address + ?DO .. LOOP headroom: data 5 below canary, return 6 below its return address + DO .. LEAVE .. LOOP headroom: data 5 below canary, return 6 below its return address + nested DO, I and J headroom: data 5 below canary, return 4 below its return address + 3104 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_manage.c] +v4 manage tests: V4_CELL_BITS=32 + 78 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_node.c] +v4 node tests: V4_CELL_BITS=32, 1024 words + node: 1024 words + 52 head + 52 tail boundary (10.2% overhead) + 1078 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_numout.c] +v4 number-output tests: V4_CELL_BITS=32 + code: 382 of 1024 words + SPACES headroom: data 6 below canary, return 7 below its return address + . headroom: data 3 below canary, return 2 below its return address + .R headroom: data 3 below canary, return 2 below its return address + U. headroom: data 3 below canary, return 3 below its return address + U.R headroom: data 3 below canary, return 3 below its return address + D. headroom: data 3 below canary, return 2 below its return address + D.R headroom: data 3 below canary, return 2 below its return address + 25242 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_pictured.c] +v4 pictured-output tests: V4_CELL_BITS=32 + <# #S #> headroom: data 3 below canary, return 3 below its return address + signed picture headroom: data 3 below canary, return 2 below its return address + 4716 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_port.c] +v4 port tests: V4_CELL_BITS=32 + 25 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_printing.c] +v4 printing tests (? Q.PRINT DUMP BASE HLD): V4_CELL_BITS=32 + code: 506 of 1024 words + DECIMAL headroom: data 7 below canary, return 8 below its return address + ? headroom: data 3 below canary, return 2 below its return address + Q.PRINT headroom: data 3 below canary, return 3 below its return address + DUMP headroom: data 3 below canary, return 4 below its return address + 13439 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_stack.c] +v4 stack tests: V4_CELL_BITS=32, data depth 10, return depth 9 + exhaustive: 2046 sequences of length <= 10 + differential: 200000 ops + 730137 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_strings.c] +v4 string tests: V4_CELL_BITS=32 + code: 234 of 1024 words + COUNT headroom: data 6 below canary, return 6 below its return address + CMOVE headroom: data 4 below canary, return 5 below its return address + CMOVE> headroom: data 3 below canary, return 5 below its return address + MOVE headroom: data 5 below canary, return 6 below its return address + FILL headroom: data 4 below canary, return 5 below its return address + BLANK headroom: data 4 below canary, return 5 below its return address + -TRAILING headroom: data 5 below canary, return 6 below its return address + COMPARE headroom: data 3 below canary, return 5 below its return address + SEARCH headroom: data 2 below canary, return 5 below its return address + SCAN headroom: data 4 below canary, return 5 below its return address + SKIP headroom: data 4 below canary, return 5 below its return address + 16729 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_terminal.c] +v4 terminal-output tests: V4_CELL_BITS=32 + KEY headroom: data 8 below canary + EMIT headroom: data 7 below canary, return 8 below its return address + CR headroom: data 7 below canary, return 8 below its return address + TYPE headroom: data 5 below canary, return 6 below its return address + 1212 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_text.c] +v4 text assembler tests: V4_CELL_BITS=32 + 240 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_umul.c] +v4 umul tests: V4_CELL_BITS=32 + 2009 checks, 0 failures + [V4_CELL_BITS=32 run-32-test_wire.c] +v4 wire tests: V4_CELL_BITS=32, 1024 cells to a queue + 112 checks, 0 failures +rc=0 diff --git a/logs/20261118-ram-blocks-knob/test-after.log b/logs/20261118-ram-blocks-knob/test-after.log new file mode 100644 index 00000000..3214f423 --- /dev/null +++ b/logs/20261118-ram-blocks-knob/test-after.log @@ -0,0 +1,9 @@ +PASS: the knob's default is 2048, and BLK_RAM_BLOCKS and BLK_DISK_START are 2080 as before +PASS: default build: a page at 2047 is refused +PASS: default build: a page at 2048 is taken +PASS: knob 4096: a page at 3000 is refused +PASS: knob 4096: a page at 4096 is taken +PASS: kernel/Makefile: the kernel's C flags carry it +PASS: kernel/Makefile: mkcapsule is built with it +PASS: kernel/Makefile: mkartemis is built with it +RESULT: PASS diff --git a/logs/20261118-ram-blocks-knob/test-before.log b/logs/20261118-ram-blocks-knob/test-before.log new file mode 100644 index 00000000..c18a3e62 --- /dev/null +++ b/logs/20261118-ram-blocks-knob/test-before.log @@ -0,0 +1,10 @@ +FAIL: the knob's default is 2048, and BLK_RAM_BLOCKS and BLK_DISK_START are 2080 as before +PASS: default build: a page at 2047 is refused +PASS: default build: a page at 2048 is taken +FAIL: knob 4096: a page at 3000 is refused +PASS: knob 4096: a page at 4096 is taken +FAIL: kernel/Makefile: the kernel's C flags carry it +FAIL: kernel/Makefile: mkcapsule is built with it +FAIL: kernel/Makefile: mkartemis is built with it +RESULT: FAIL +note: the three kernel/Makefile checks failed before for two reasons -- no knob yet, and the test's own SIGPIPE flaw (printf | grep -q under pipefail), fixed in the test before the after-run diff --git a/scripts/test_capsule_ram_blocks.sh b/scripts/test_capsule_ram_blocks.sh new file mode 100755 index 00000000..3c939acd --- /dev/null +++ b/scripts/test_capsule_ram_blocks.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LicenseRef-Starship-1.0 +# Copyright (c) 2023-2026 Robert A. James +# test_capsule_ram_blocks.sh -- the tests of the RAM block count as a build knob +# (docs/v4.0.0/plans/2026-11-18-capsule-blocks.md, ruling 3 and step 1). +# +# What is checked: +# - the knob, BLK_RAM_USER_BLOCKS, is the VM's user RAM block count (2048 by default), and +# block_subsystem.h derives BLK_RAM_BLOCKS from it (2080 = 2048 + 32 reserved, as before); +# - mkcapsule's floor is the knob, not a literal 2048: built with the knob at 4096 it refuses a page +# at 3000 and takes one at 4096; built with the default it refuses 2047 and takes 2048; +# - kernel/Makefile gives the knob to the kernel's C code, to mkcapsule and to mkartemis. +# +# No QEMU. Prints PASS:/FAIL: per check and RESULT:; exits 0 only if every check passes. +set -uo pipefail +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +T=$(mktemp -d) +trap 'rm -rf "$T"' EXIT +ok=1 +check() { if eval "$2"; then echo "PASS: $1"; else echo "FAIL: $1"; ok=0; fi; } + +SRC="$ROOT/tools/mkcapsule.c $ROOT/tools/pkcs8_ed25519.c $ROOT/kernel/src/crypto/ed25519.c \ + $ROOT/kernel/src/crypto/fe25519.c $ROOT/kernel/src/crypto/scalar25519.c \ + $ROOT/kernel/src/crypto/sha512.c $ROOT/kernel/src/crypto/x509_ed25519.c" +INC="-I$ROOT/v3/include -I$ROOT/kernel/include -I$ROOT/tools" +build() { # build [knob] + cc -std=c99 -O2 $INC ${2:+-DBLK_RAM_USER_BLOCKS=$2} -o "$1" $SRC 2> "$T/cc-$(basename "$1").log" +} +capsule() { # capsule : a one-page capsule + mkdir -p "$1"; printf 'Block %s\n( one page )\n' "$2" > "$1/one.4th" +} + +# the knob, as C sees it +cat > "$T/layout.c" <<'EOF' +#include "block_subsystem.h" +#include +int main(void) { printf("%u %u %u\n", (unsigned)BLK_RAM_USER_BLOCKS, (unsigned)BLK_RAM_BLOCKS, (unsigned)BLK_DISK_START); return 0; } +EOF +cc -std=c99 $INC -o "$T/layout" "$T/layout.c" 2> "$T/cc-layout.log" +check "the knob's default is 2048, and BLK_RAM_BLOCKS and BLK_DISK_START are 2080 as before" \ + '[ "$("$T/layout" 2>/dev/null)" = "2048 2080 2080" ]' + +# mkcapsule's floor is the knob +build "$T/mk-default" +build "$T/mk-4096" 4096 +capsule "$T/c2047" 2047; capsule "$T/c2048" 2048; capsule "$T/c3000" 3000; capsule "$T/c4096" 4096 +check "default build: a page at 2047 is refused" '! "$T/mk-default" --lint "$T/c2047" > /dev/null 2>&1' +check "default build: a page at 2048 is taken" '"$T/mk-default" --lint "$T/c2048" > /dev/null 2>&1' +check "knob 4096: a page at 3000 is refused" '! "$T/mk-4096" --lint "$T/c3000" > /dev/null 2>&1' +check "knob 4096: a page at 4096 is taken" '"$T/mk-4096" --lint "$T/c4096" > /dev/null 2>&1' + +# kernel/Makefile hands the knob on (a here-string, not a pipe: grep -q would end a printf with SIGPIPE under pipefail) +DB=$(cd "$ROOT" && make -s -pn -f kernel/Makefile ARCH=amd64 BLK_RAM_USER_BLOCKS=4096 2>/dev/null) +check "kernel/Makefile: the kernel's C flags carry it" 'grep -q -- "-DBLK_RAM_USER_BLOCKS=4096" <<< "$DB"' +check "kernel/Makefile: mkcapsule is built with it" 'grep -q -- "^MKCAPSULE_DEFS *:\?= *-DBLK_RAM_USER_BLOCKS=4096" <<< "$DB"' +check "kernel/Makefile: mkartemis is built with it" 'grep -q -- "^MKARTEMIS_DEFS *:\?= *-DBLK_RAM_USER_BLOCKS=4096" <<< "$DB"' + +if [ $ok = 1 ]; then echo "RESULT: PASS"; else echo "RESULT: FAIL"; fi +[ $ok = 1 ] diff --git a/tools/mkcapsule.c b/tools/mkcapsule.c index 54f384fd..9ffa5e1f 100644 --- a/tools/mkcapsule.c +++ b/tools/mkcapsule.c @@ -55,6 +55,7 @@ #include #include +#include "blk_layout.h" #include "pkcs8_ed25519.h" #include "starkernel/ed25519.h" #include "starkernel/x509_ed25519.h" @@ -408,14 +409,16 @@ static int validate_forth_blocks(const char *fpath, block_num = (int)strtol((const char *)(data + start + 6), NULL, 10); line_in_block = 0; - /* Blocks 0..2047 are the VM's fast RAM and the only ones a - * capsule may not claim; there is no upper bound - * (docs/v4.0.0/NUCLEUS.md 5.2). */ - if (block_num < 2048) { + /* Blocks 0 .. BLK_RAM_USER_BLOCKS - 1 are the VM's fast RAM and + * the only ones a capsule page may not name: a page is copied + * down by the RAM block count to be interpreted. The count is + * the build's knob (blk_layout.h; capsule blocks plan, ruling 3), + * not a literal; there is no upper bound. */ + if (block_num < (int)BLK_RAM_USER_BLOCKS) { fprintf(stderr, "mkcapsule: ERROR: %s:%d: block %d is in the VM's fast " - "RAM (0..2047)\n", - fpath, file_line, block_num); + "RAM (0..%u)\n", + fpath, file_line, block_num, (unsigned)BLK_RAM_USER_BLOCKS - 1u); errors++; } @@ -1091,7 +1094,7 @@ static int blocks_free_at_delta(const int *blocks, int block_count, int delta, int skip_idx) { for (int j = 0; j < block_count; j++) { int candidate = blocks[j] + delta; - if (candidate < 2048) return 0; /* system-reserved floor */ + if (candidate < (int)BLK_RAM_USER_BLOCKS) return 0; /* the VM's fast RAM: the build's knob (blk_layout.h) */ if (reserved_owner_of(candidate)) return 0; for (int i = 0; i < manifest_count; i++) { if (i == skip_idx) continue; diff --git a/v3/include/blk_layout.h b/v3/include/blk_layout.h new file mode 100644 index 00000000..3b439cd8 --- /dev/null +++ b/v3/include/blk_layout.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: LicenseRef-Starship-1.0 + * Copyright (c) 2023-2026 Robert A. James + */ +/* blk_layout.h -- the VM's user RAM block count, the one knob the block layout is derived from. + * + * BLK_RAM_USER_BLOCKS is how many blocks of fast RAM a VM sees (LBN 0 .. BLK_RAM_USER_BLOCKS - 1). + * It is a build knob (Kconfig BLK_RAM_USER_BLOCKS; kernel/Makefile passes it as -D), and the tools + * that make the kernel's media are built with the same value: mkcapsule takes it as its floor -- + * a capsule's page `Block n` has n at least this, and is copied down by it to be interpreted -- + * and mkartemis lays out a disk by it (block_subsystem.h derives BLK_RAM_BLOCKS and BLK_DISK_START). + * docs/v4.0.0/plans/2026-11-18-capsule-blocks.md, ruling 3 (Captain Bob: "The RAM block count"). + * + * Nothing else is in this header, so a host tool can include it alone. + */ +#ifndef BLK_LAYOUT_H +#define BLK_LAYOUT_H + +#ifndef BLK_RAM_USER_BLOCKS +#define BLK_RAM_USER_BLOCKS 2048u +#endif + +#endif /* BLK_LAYOUT_H */ diff --git a/v3/include/block_subsystem.h b/v3/include/block_subsystem.h index 8fd9081c..acfcf0ab 100644 --- a/v3/include/block_subsystem.h +++ b/v3/include/block_subsystem.h @@ -68,6 +68,7 @@ #include #include "vm.h" #include "blkio.h" /* ensure struct blkio_dev is fully visible */ +#include "blk_layout.h" /* BLK_RAM_USER_BLOCKS, the knob the layout below is derived from */ #ifdef __cplusplus extern "C" { @@ -75,8 +76,8 @@ extern "C" { /* Core configuration constants */ #define BLK_FORTH_SIZE 1024u /* Forth block size */ -#define BLK_RAM_BLOCKS 2080u /* Physical RAM blocks (user-visible LBN 0..2047) */ -#define BLK_DISK_START 2080u /* Device-backed Forth blocks start at LBN 2080 */ +#define BLK_RAM_BLOCKS (BLK_RAM_USER_BLOCKS + BLK_FORTH_SYS_RESERVED) /* Physical RAM blocks: the user's (blk_layout.h; 2048 by default, LBN 0..2047) and the reserved ones -- 2080 by default */ +#define BLK_DISK_START BLK_RAM_BLOCKS /* Device-backed Forth blocks start after the RAM blocks: LBN 2080 by default */ #define BLK_DEVICE_SECTOR 4096u /* Physical “devblock” size (4×1 KiB blkio units) */ #define BLK_PACK_RATIO 3u /* 3× 1 KiB data per 4 KiB devblock (plus 1 KiB metadata) */ #define BLK_META_TOTAL 1024u /* Last 1 KiB in a 4 KiB devblock is metadata */