目录文档-技术白皮书32-EFT.WP.Cosmo.LayeredSea v1.0

附录D 参考实现与测试脚本清单


I. 一句话目标

一句话目标:提供与模板 v0.1(《EFT 技术白皮书与技术备忘模板 全面清单 v0.1》)接口族一致的最小参考实现与测试脚本清单,给出目录、入口、配置、运行与审计规范,使 SeaProfile、Phi_T/grad_Phi_T、n_eff、{ ell_i }、Delta_T_sigma、R_sea/T_trans/A_sigma 与两口径 T_arr/ΔT_arr 的端到端流程可落地、可复现、可审计


II. 适用范围与非目标


III. 参考实现目录结构(建议)

ref_ls/ 参考实现根目录
  1. core/ 物理与数值核心
    • phi.py(I.Build.Phi → apply_sea_matching,gradient)
    • neff.py(I.Build.Neff → estimate_neff_sea)
    • arrival.py(I.Arrival.Constant|General|Delta → arrival_time_in_sea,delta_arrival_in_sea)
    • interfaces.py(I.Interface.ApplyMatching / I.Path.Segment / I.Path.InterfaceCorrection → detect_sea_intersections,segment_integrals,interface_correction_sea)
    • echo.py(多路径/回声 → simulate_multipath_LS)
    • metrics.py(I.Consistency.DualMode|ThinThick / I.Uncertainty.GUM|MC → check_dual_arrival_consistency,consistency_thin_vs_thick_LS,propagate_uncertainty_GUM,propagate_uncertainty_MC)
  2. io/ 数据与契约
    • contract.py(Contract 读写与校验)
    • dataio.py(读写 SeaProfile,Path,Field,Observations,RTParams)
    • hashing.py(hash(SeaProfile),hash(Phi_T),hash(grad_Phi_T),hash(n_eff),hash(gamma))
  3. utils/ 通用工具
    • solvercfg.py(求积法/步长阈值/并发策略构建)
    • logger.py(I.Report.Log|Emit → log_artifacts_LS,emit_measurement_report)
    • rng.py(MC 可播种随机源)
  4. scripts/ 基准与测试脚本(见 V)
  5. configs/ 运行配置与样例(见 VII)
  6. artifacts/ 结果与审计产物(日志、报告、哈希清单、重放清单)

命名隔离:严禁将 T_fil 与 T_trans 混用,严禁将 n 与 n_eff 混用;入口强制 n_eff ≥ 1 与量纲核查。


IV. 核心模块最小接口(模板接口族 → 本卷 I60-*)


V. 脚本清单与用途(最小集合)


VI. 运行示例(CLI)

python scripts/run_thinlayer.py \

--contract configs/ls.contract.json \

--sea configs/ls.tanh.json \

--path paths/p001.path.jsonl \

--solvercfg configs/solver.ls.json \

--out artifacts/thinlayer/

python scripts/run_dispersion.py \

--contract configs/ls.contract.json \

--phi fields/phi_t.zarr --gphi fields/grad_phi_t.zarr \

--obs obs/p001.obs.jsonl --fgrid configs/fgrid.json \

--out artifacts/dispersion/

python scripts/run_dual_consistency.py \

--contract configs/ls.contract.json \

--path paths/p001.path.jsonl --neff fields/neff.zarr \

--cref calib/c_ref.json --out artifacts/consistency/

python scripts/run_uncertainty_gum.py \

--contract configs/ls.contract.json \

--inputs artifacts/dispersion/results.json \

--out artifacts/uncertainty/gum/

python scripts/run_uncertainty_mc.py \

--contract configs/ls.contract.json \

--inputs artifacts/dispersion/results.json \

--nsamples 20000 --seed 20250905 \

--out artifacts/uncertainty/mc/


VII. 配置样例(最小可用)

{

"spec_version":"EFT.WP.Cosmo.LayeredSea v1.0",

"coords_spec":"Comoving-Spherical",

"units_spec":{"length":"m","time":"s","speed":"m·s^-1","frequency":"Hz"},

"metric_spec":{"type":"FLRW-like","S_k":"sin","a_ref":1.0},

"mode":"constant",

"gauge":{"x_ref":[0,0,0],"t_ref":"2025-01-01T00:00:00Z"},

"tolerances":{"eps_T":1e-9,"eta_T":5e-10,"eta_w":0.03,"tau_switch":5e-12}

}

{"layers":[{"model":"tanh","chi_k":1.2e3,"Delta_k":2.0e2,"sigma_k":1.0e2}],"eta_w":0.03}

{"quad":"adaptive_simpson","step_rule":"curvature_medium_layer",

"tau_geom":0.02,"tau_medium":0.01,"tau_sea":0.005,

"convergence":{"levels":[1.0,0.5,0.25],"eps_T":1e-9},

"parallel":{"freq":"threads","paths":"threads"}}

{"f0":1.0e9,"band":[-5.0e7,5.0e7],"nodes":[9.5e8,1.0e9,1.05e9]}


VIII. 输出与日志(最小集)


IX. 复现流程(一键重放)

python scripts/run_report.py --manifest artifacts/manifest.json --out artifacts/report/


X. 安全与完整性


XI. 模板接口族映射速览(锚定模板 v0.1)

工程映射:参见本卷 I60-* 清单(第 IV 节)。


XII. 交叉引用


XIII. 产出物


版权与许可(CC BY 4.0)

版权声明:除另有说明外,《能量丝理论》(含文本、图表、插图、符号与公式)的著作权由作者(“屠广林”先生)享有。
许可方式:本作品采用 Creative Commons 署名 4.0 国际许可协议(CC BY 4.0)进行许可;在注明作者与来源的前提下,允许为商业或非商业目的进行复制、转载、节选、改编与再分发。
署名格式(建议):作者:“屠广林”;作品:《能量丝理论》;来源:energyfilament.org;许可证:CC BY 4.0。

首次发布: 2025-11-11|当前版本:v5.1
协议链接:https://creativecommons.org/licenses/by/4.0/