# SINDy-SR Task List & Execution Notes

> This file is the **active task list** for SINDy / PySR symbolic regression work.
> It is referenced by `sindy_sr_knowledge.md` as the source of truth for execution
> order, phase boundaries, and current task status.
> 
> Background knowledge, confirmed facts, bug history, and result interpretation
> belong in `sindy_sr_knowledge.md`.  This file only tracks **what to do next**.

---

## 1. Current Task Status (2026-06-28)

### Completed

- [x] Karman cross-Re joint formula: `α_F = daF_dt − 14.952·μ·Cl_tot`, `α_T = 3.414` (constant)
- [x] Karman deep individual per-Re formulas (niter=120)
- [x] Karman re400 short-SI test (SI=400 optimal at 0.819)
- [x] Illusion 0.75L individual PySR: `α_F = −0.169·(Cl_tot + dCl_tot/dt) − 1.240`
- [x] Illusion 1L individual PySR: `α_F = (du_a/dt + u_a + 26.5)·0.0123`
- [x] Illusion joint formula (Method B): `α_F = Cd_tot − (Cd_err + 5.428) − 0.00978·(du_a/dt + u_a)`, CFD 0.75L=0.978, 1L=0.970
- [x] Illusion generalization CFD (0.5L−2.0L) via joint formula
- [x] Vortex generalization (Karman joint formula): lamb=0.949, taylor=0.905
- [x] Illusion 1.5L characterized as high-frequency periodic modulation (not SR-amenable)
- [x] G-equivariance bug fixed
- [x] Bug #13/#14/#15/#16 all fixed
- [x] `docs/SR_analysis_report.md` written (465 lines)
- [x] `docs/illusion_joint_formula_analysis.md` written

### In Progress (Phase P0 — 2026-06-28)

- [ ] P0.1: Triage 136 JSON result files → classify, archive intermediates
- [ ] P0.2: Create `validate/results/README.md` (reference table for canonical files)
- [ ] P0.3: Update `README.md` directory tree and Key Documentation table
- [ ] P0.4: Update `SR_analysis_report.md` §8 with generalization rows
- [ ] P0.5: Fix doc error in `illusion_joint_formula_analysis.md` line 46 (1.5L value)

### Pending (Phase P2)

- [ ] P2.1: Regenerate PPO rollouts for 0.75L, 1L, 1.5L
- [ ] P2.2: Run SR closed-loop CFD for 1.2L and 2L with full telemetry
- [ ] P2.3: Create `scripts/analyze_illusion_degradation.py`
- [ ] P2.4: Document degradation analysis in `illusion_joint_formula_analysis.md` §2.3

### Pending (Phase P3)

- [ ] P3.1: Run 1L with-target CFD validation
- [ ] P3.2: Document results

---

## 2. Known Open Items (Cannot Claim Closure Yet)

From `sindy_sr_knowledge.md` §三:

1. **"All cloak share same skeleton"** — Cannot claim. Karman and Illusion formulas are structurally different.
2. **"Karman cross-Re joint formula fully solved"** — Cannot claim. Rear is constant (α_T = 3.414), rear control information not fully utilized.
3. **"High-Re degradation proven to be sampling rate issue"** — Strong hypothesis, not proven.
4. **"SR is completely done"** — Karman is complete. Illusion has gaps: 1.5L mechanism unexplained, 1L with-target untested, joint + with-target not run.

---

## 3. Unfinished Work from Handover (2026-06-25)

| # | Item | Priority |
|---|------|----------|
| 1 | Rebuild `sindy_sr_notes.md` | P0 |
| 2 | Write generalization results table into `SR_analysis_report.md` §8 | P0 |
| 3 | Fix `illusion_joint_formula_analysis.md` 1.5L line 46 value | P0 |
| 4 | README directory tree: add `gen_illusion_target.py`, `batch_illusion_generalization.sh` | P0 |
| 5 | README Key Documentation table: add `illusion_joint_formula_analysis.md` | P0 |
| 6 | Create `validate/results/README.md` | P0 |
| 7 | Illusion large-diameter deep analysis (1.5L/2.0L) | P2 |
| 8 | 1L with-target CFD validation | P3 |
| 9 | Illusion joint + with-target search | Future |
| 10 | re400 independent PySR formula CFD | Future |
| 11 | Erase scene (no PPO data yet) | Blocked |

---

## 4. Recommended Formula Files

### Canonical (use these for all papers/reports)

| Scene | Front JSON | Top JSON | CFD Similarity |
|-------|-----------|----------|:---:|
| Karman cross-Re (joint) | `validate/results/karman_joint_deep_front.json` | `validate/results/karman_joint_deep_top.json` | 0.847 avg |
| Illusion joint (0.75L+1L) | `validate/results/pysr_illusion_joint_front.json` | `validate/results/pysr_illusion_joint_top.json` | 0.978/0.970 |
| Karman re50 (individual) | `validate/results/pysr_karman_re50_front_deep.json` | `validate/results/pysr_karman_re50_top_deep.json` | 0.895 |
| Karman re100 (individual) | `validate/results/pysr_karman_re100_front_deep.json` | `validate/results/pysr_karman_re100_top_deep.json` | 0.888 |
| Karman re200 (individual) | `validate/results/pysr_karman_re200_front_deep.json` | `validate/results/pysr_karman_re200_top_deep.json` | 0.916 |
| Illusion 0.75L (individual) | `validate/results/pysr_illusion_0.75L_front.json` | `validate/results/pysr_illusion_0.75L_top.json` | 0.979 |
| Illusion 1L (individual) | `validate/results/pysr_illusion_1L_front.json` | `validate/results/pysr_illusion_1L_top.json` | 0.957 |

---

## 5. Priority Markers

| Marker | Meaning |
|--------|---------|
| **P0** | Must complete for paper-ready state |
| **P1** | Analysis deepening (defer until P0 done) |
| **P2** | Research extension (1.5L/2.0L mechanism) |
| **P3** | Optional micro-experiments |
| **Future** | Nice-to-have, not urgent |
| **Blocked** | Prerequisites not met |

---

## 6. Quick Commands Reference

```bash
# PPO inference (pycuda_3_10, GPU 2)
conda run -n pycuda_3_10 python src/SR_analysis/scripts/infer_karman.py --re 100 --device 2
conda run -n pycuda_3_10 python src/SR_analysis/scripts/infer_illusion.py --diameter 1.0 --device 2
conda run -n pycuda_3_10 python src/SR_analysis/scripts/infer_vortex.py --type lamb --device 2

# Target generation for generalization scenes
conda run -n pycuda_3_10 python src/SR_analysis/scripts/gen_illusion_target.py --scene all --device 2

# PySR search (sr_env)
conda run -n sr_env python src/SR_analysis/sindy/run_pysr_deep.py --both
conda run -n sr_env python src/SR_analysis/sindy/run_pysr_deep_illusion.py --both

# CFD closed-loop validation (pycuda_3_10, GPU 2)
conda run -n pycuda_3_10 python src/SR_analysis/validate/run_closed_loop.py \
    --scene karman_re100 --device 2 --steps 200 --mode pysr \
    --pysr-front validate/results/karman_joint_deep_front.json \
    --pysr-top validate/results/karman_joint_deep_top.json

conda run -n pycuda_3_10 python src/SR_analysis/validate/run_closed_loop_illusion.py \
    --scene illusion_1L --device 2 --steps 214 --mode pysr \
    --pysr-front validate/results/pysr_illusion_joint_front.json \
    --pysr-top validate/results/pysr_illusion_joint_top.json

# Batch generalization validation
bash src/SR_analysis/validate/batch_illusion_generalization.sh
```
