Initial renunney scaffold

This commit is contained in:
Codex 2026-04-11 06:16:02 -04:00
commit 61313daee4
10 changed files with 279 additions and 0 deletions

25
.gitignore vendored Normal file
View File

@ -0,0 +1,25 @@
.DS_Store
__pycache__/
.pytest_cache/
*.pyc
*.pyo
*.pyd
.Python
.venv/
venv/
build/
dist/
*.egg-info/
runs/state/*
!runs/state/.gitkeep
runs/results/*
!runs/results/.gitkeep
runs/scratch/*
!runs/scratch/.gitkeep
*.sqlite
*.sqlite3
*.log
*.tmp
*.swp

90
Makefile Normal file
View File

@ -0,0 +1,90 @@
PYTHON := python3
REPO_ROOT := $(abspath .)
LEGACY_ROOT := $(REPO_ROOT)/../collaborations/to_ptbc/evc/cost_of_substitution
ORCH := $(LEGACY_ROOT)/python/run_orchestration.py
DB := $(REPO_ROOT)/runs/state/cos-orch.sqlite
RESULT_ROOT := $(REPO_ROOT)/runs/results
SCRATCH_ROOT := $(REPO_ROOT)/runs/scratch
FIG1_M005 := $(LEGACY_ROOT)/examples/track1_figure1_paper_M_0_05.json
FIG1_M025 := $(LEGACY_ROOT)/examples/track1_figure1_paper_M_0_25.json
FIG1_M05 := $(LEGACY_ROOT)/examples/track1_figure1_paper_M_0_5.json
FIG1_M10 := $(LEGACY_ROOT)/examples/track1_figure1_paper_M_1_0.json
FIG1_M100 := $(LEGACY_ROOT)/examples/track1_figure1_paper_M_10_0.json
.PHONY: help init doctor list-jobs run-one run-loop run-loop-one collate-figure1 \
submit-figure1-m005 submit-figure1-m025 submit-figure1-m05 submit-figure1-m10 submit-figure1-m100 \
submit-all-figure1 status results-tree
help:
@echo "Targets:"
@echo " init Create run directories and initialize the SQLite registry"
@echo " doctor Show key paths and verify legacy orchestration entrypoint"
@echo " list-jobs List jobs in the local registry"
@echo " run-one Claim and run one queued job"
@echo " run-loop Run worker loop until queue empty"
@echo " run-loop-one Run exactly one queued job through the worker loop"
@echo " collate-figure1 Collate completed Track 1 Figure 1 jobs"
@echo " submit-figure1-m005 Submit Figure 1 paper-scale jobs for M=0.05"
@echo " submit-figure1-m025 Submit Figure 1 paper-scale jobs for M=0.25"
@echo " submit-figure1-m05 Submit Figure 1 paper-scale jobs for M=0.5"
@echo " submit-figure1-m10 Submit Figure 1 paper-scale jobs for M=1.0"
@echo " submit-figure1-m100 Submit Figure 1 paper-scale jobs for M=10.0"
@echo " submit-all-figure1 Submit all paper-scale Figure 1 treatments"
@echo " status Show job status and current result tree"
@echo " results-tree List the current result files"
init:
mkdir -p $(REPO_ROOT)/runs/state $(REPO_ROOT)/runs/results $(REPO_ROOT)/runs/scratch
$(PYTHON) $(ORCH) init-db --db $(DB)
doctor:
@echo "REPO_ROOT=$(REPO_ROOT)"
@echo "LEGACY_ROOT=$(LEGACY_ROOT)"
@echo "DB=$(DB)"
@echo "RESULT_ROOT=$(RESULT_ROOT)"
@echo "SCRATCH_ROOT=$(SCRATCH_ROOT)"
test -f $(ORCH)
list-jobs:
$(PYTHON) $(ORCH) list --db $(DB)
run-one:
$(PYTHON) $(ORCH) run-one --db $(DB) --result-root $(RESULT_ROOT) --scratch-root $(SCRATCH_ROOT)
run-loop:
$(PYTHON) $(ORCH) run-loop --db $(DB) --result-root $(RESULT_ROOT) --scratch-root $(SCRATCH_ROOT)
run-loop-one:
$(PYTHON) $(ORCH) run-loop --db $(DB) --result-root $(RESULT_ROOT) --scratch-root $(SCRATCH_ROOT) --max-jobs 1
collate-figure1:
$(PYTHON) $(ORCH) collate-figure1 --db $(DB) --output $(RESULT_ROOT)/figure1-collated.json
submit-figure1-m005:
$(PYTHON) $(ORCH) submit-figure1 --db $(DB) --config $(FIG1_M005) --job-prefix fig1-m005 --created-by make
submit-figure1-m025:
$(PYTHON) $(ORCH) submit-figure1 --db $(DB) --config $(FIG1_M025) --job-prefix fig1-m025 --created-by make
submit-figure1-m05:
$(PYTHON) $(ORCH) submit-figure1 --db $(DB) --config $(FIG1_M05) --job-prefix fig1-m05 --created-by make
submit-figure1-m10:
$(PYTHON) $(ORCH) submit-figure1 --db $(DB) --config $(FIG1_M10) --job-prefix fig1-m10 --created-by make
submit-figure1-m100:
$(PYTHON) $(ORCH) submit-figure1 --db $(DB) --config $(FIG1_M100) --job-prefix fig1-m100 --created-by make
submit-all-figure1: submit-figure1-m005 submit-figure1-m025 submit-figure1-m05 submit-figure1-m10 submit-figure1-m100
results-tree:
find $(RESULT_ROOT) -maxdepth 4 -type f | sort
status:
@echo "Jobs:"
$(PYTHON) $(ORCH) list --db $(DB)
@echo
@echo "Results:"
find $(RESULT_ROOT) -maxdepth 4 -type f | sort || true

68
README.md Normal file
View File

@ -0,0 +1,68 @@
# renunney
Clean working repository for:
- faithful replication of Leonard Nunney's 2003 cost-of-substitution results,
- orchestration of distributed sweep runs,
- later migration to a faster Rust-backed worker.
## Current Scope
This repository is the clean operational wrapper around the current work in:
- [`../collaborations/to_ptbc/evc/cost_of_substitution`](/mnt/CIFS/pengolodh/Docs/Projects/collaborations/to_ptbc/evc/cost_of_substitution)
The current orchestration and Track 1 simulation code still live there.
`renunney` provides:
- a clean git repo,
- a stable working directory layout,
- a Makefile for common tasks,
- migration notes for pulling code into this repo in stages.
## Layout
- `docs/`
- project and migration notes
- `config/`
- configuration templates and examples
- `runs/state/`
- SQLite registries and persistent orchestration state
- `runs/results/`
- result artifacts collected by orchestration
- `runs/scratch/`
- local worker scratch and cache files
- `src/renunney/`
- future in-repo Python package and migration target
## Start
Initialize the local run directories and SQLite registry:
```bash
make init
```
Submit a paper-scale Figure 1 treatment:
```bash
make submit-figure1-m10
```
Run one worker loop locally:
```bash
make run-loop
```
Collate completed Figure 1 jobs:
```bash
make collate-figure1
```
## Status
The active simulation/orchestration implementation remains in the older
`cost_of_substitution` directory for now. This repo is the clean shell for
running, organizing, and gradually migrating that work.

10
config/README.md Normal file
View File

@ -0,0 +1,10 @@
# Config
Configuration templates and future environment-specific settings for:
- master registry paths
- result roots
- scratch roots
- host-specific worker defaults
This directory is intentionally small for now.

38
docs/MIGRATION.md Normal file
View File

@ -0,0 +1,38 @@
# Migration
## Goal
Move the current cost-of-substitution implementation into `renunney` in staged,
low-risk steps.
## Current State
Operational code still lives in:
- [`../../collaborations/to_ptbc/evc/cost_of_substitution`](/mnt/CIFS/pengolodh/Docs/Projects/collaborations/to_ptbc/evc/cost_of_substitution)
`renunney` currently acts as:
- a clean git repository,
- a run-control wrapper,
- a stable place for deployment and orchestration commands,
- the eventual destination for migrated code.
## Recommended Migration Order
1. Keep orchestration running from the legacy path until real multi-host runs are stable.
2. Migrate the orchestration modules first:
- `python/orchestration.py`
- `python/run_orchestration.py`
3. Migrate Track 1 runner and API next:
- `python/run_track1.py`
- `python/track1_api.py`
4. Migrate the Track 1 simulation core after the runner path is stable:
- `python/track1_reference.py`
- `python/track1_threshold.py`
- `python/track1_analysis.py`
5. Migrate docs and example configs last, after path references are updated.
## Constraint
Do not break the ability to run current Figure 1 jobs while migrating code.

44
docs/WORKFLOW.md Normal file
View File

@ -0,0 +1,44 @@
# Workflow
## Daily Use
Initialize local state:
```bash
make init
```
Check paths:
```bash
make doctor
```
Submit a Figure 1 treatment:
```bash
make submit-figure1-m10
```
Run jobs:
```bash
make run-loop
```
Collate completed results:
```bash
make collate-figure1
```
Inspect current status:
```bash
make status
```
## Current Assumption
The Makefile drives the orchestration code in the legacy
`cost_of_substitution` directory until that code is migrated here.

1
runs/results/.gitkeep Normal file
View File

@ -0,0 +1 @@

1
runs/scratch/.gitkeep Normal file
View File

@ -0,0 +1 @@

1
runs/state/.gitkeep Normal file
View File

@ -0,0 +1 @@

1
src/renunney/__init__.py Normal file
View File

@ -0,0 +1 @@
"""renunney package placeholder."""