omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / calibration / scripts / tc_exp.sh
| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | # tc_exp.sh: experiment selection for the calibration scripts (POSIX sh; sourced, never run). |
| 17 | # |
| 18 | # EXP_ID=EXP-001 (default) Turing-profile-v1.0, calibration/experiments/EXP-001, preregistration EXP-001.md |
| 19 | # EXP_ID=EXP-001R successor run: Turing-profile-v1.1, calibration/experiments/EXP-001R, preregistration EXP-001R.md |
| 20 | # |
| 21 | # EXP_DIR EXP_PREREG EXP_PROFILE_VER EXP_PROFILE_ID EXP_PROFILE EXP_SIDECAR EXP_PROFILE_NAME |
| 22 | # EXP_CAND_STORE committed candidate files. EXP-001R uses the EXP-001 files unchanged (same seven |
| 23 | # candidates, no refit), so both experiments point at calibration/experiments/EXP-001/candidates. |
| 24 | # EXP_POWER the power simulation output; the design is unchanged, so always the EXP-001 file. |
| 25 | EXP_ID="${EXP_ID:-EXP-001}" |
| 26 | case "$EXP_ID" in |
| 27 | EXP-001) EXP_PROFILE_VER=1.0 ;; |
| 28 | EXP-001R) EXP_PROFILE_VER=1.1 ;; |
| 29 | *) echo "tc_exp: unknown EXP_ID '$EXP_ID' (EXP-001 or EXP-001R)" >&2; exit 2 ;; |
| 30 | esac |
| 31 | EXP_DIR="calibration/experiments/$EXP_ID" |
| 32 | EXP_PREREG="calibration/preregistration/$EXP_ID.md" |
| 33 | EXP_PROFILE_ID="Turing-profile-v$EXP_PROFILE_VER" |
| 34 | EXP_PROFILE_NAME="$EXP_PROFILE_ID.toml" |
| 35 | EXP_PROFILE="calibration/profiles/$EXP_PROFILE_NAME" |
| 36 | EXP_SIDECAR="calibration/profiles/$EXP_PROFILE_ID.sha256" |
| 37 | EXP_CAND_STORE="calibration/experiments/EXP-001/candidates" |
| 38 | EXP_POWER="calibration/experiments/EXP-001/power_simulation_output.txt" |
| 39 | # EXP-001R only: burned seeds (the six EXP-001 sealed seeds, one decimal per line), the amended overlap rule G6, |
| 40 | # and the EXP-001 sealed root whose traces and ledgers join the dev/burned comparison list. |
| 41 | EXP_BURNED_FILE="" EXP_G6_RULE=strict EXP_BURNED_SEALED="" |
| 42 | |
| 43 | if [ "$EXP_ID" = EXP-001R ]; then |
| 44 | EXP_BURNED_FILE="calibration/scripts/burned_seeds_exp001.txt" |
| 45 | EXP_G6_RULE=amended |
| 46 | EXP_BURNED_SEALED="${TC_EXP001_SEALED:-${HOME:-}/aien-data/turing-cal/sealed/d3cba292b9282116d1e374db22344bca4d47717e}" |
| 47 | fi |
| 48 | export EXP_ID EXP_BURNED_FILE EXP_G6_RULE EXP_BURNED_SEALED |
| 49 | |
| 50 | # tc_sealed_clear SEALED_ROOT: succeeds only if nothing lives under SEALED_ROOT except, for EXP-001R, the one |
| 51 | # directory that is exactly the burned EXP-001 root (EXP_BURNED_SEALED). EXP-001 (no burned root): any entry fails. |
| 52 | # Prints the offending entries on stdout. Used by freeze_candidate.sh --freeze (freeze must come before sealed data). |
| 53 | tc_sealed_clear() { |
| 54 | _bad="" |
| 55 | _keep="" |
| 56 | [ -z "$EXP_BURNED_SEALED" ] || _keep=$(basename "$EXP_BURNED_SEALED") |
| 57 | for _e in $(ls -A "$1" 2>/dev/null); do |
| 58 | [ -n "$_keep" ] && [ "$_e" = "$_keep" ] && continue |
| 59 | _bad="$_bad $_e" |
| 60 | done |
| 61 | [ -z "$_bad" ] || { echo "$_bad"; return 1; } |
| 62 | return 0 |
| 63 | } |