目录文档-技术白皮书31-EFT.WP.BH.TensionWall v1.0

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


I. 一句话目标

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


II. 适用范围与非目标


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

ref_tw/ 参考实现根目录
  1. core/ 物理与数值核心
    • phi.py(I.Build.Phi → apply_TW_matching,gradient)
    • neff.py(I.Build.Neff → estimate_neff_TW)
    • arrival.py(I.Arrival.Constant|General|Delta → arrival_time_with_TW,delta_arrival_TW)
    • interfaces.py(I.Interface.ApplyMatching / I.Path.Segment / I.Path.InterfaceCorrection → detect_TW_intersections,segment_integrals,interface_correction)
    • echo.py(多路径与回声 → simulate_multipath_TW)
    • metrics.py(I.Consistency.DualMode|ThinThick / I.Uncertainty.GUM|MC → check_dual_arrival_consistency,consistency_thin_vs_thick_TW,propagate_uncertainty_GUM,propagate_uncertainty_MC)
  2. io/ 数据与契约
    • contract.py(Contract 读写与校验)
    • dataio.py(读写 TWProfile,Path,Field,Observations,RTParams)
    • hashing.py(hash(Phi_T),hash(grad_Phi_T),hash(n_eff),hash(gamma),hash(TWProfile))
  3. utils/ 通用工具
    • solvercfg.py(求积法/步长阈值/并行策略构建)
    • logger.py(I.Report.Log|Emit → log_tw_propagation,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. 核心模块最小接口(模板接口族 → 本卷 I40-*)


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


VI. 运行示例(CLI)

python scripts/run_thinwall.py \

--contract configs/tw.contract.json \

--tw configs/tw.tanh.json \

--path paths/p001.path.jsonl \

--solvercfg configs/solver.tw.json \

--out artifacts/thinwall/

python scripts/run_dispersion.py \

--contract configs/tw.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/tw.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 \

--inputs artifacts/dispersion/results.json \

--out artifacts/uncertainty/gum/

python scripts/run_uncertainty_mc.py \

--inputs artifacts/dispersion/results.json \

--nsamples 20000 --seed 20250905 \

--out artifacts/uncertainty/mc/


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

{

"spec_version":"EFT.WP.BH.TensionWall v1.0",

"coords_spec":"Spherical",

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

"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}

}

{"model":"tanh","r_H":1.8e9,"Delta_w":1.2e6,"sigma_w":6.0e5,"eta_w":0.03}

{"quad":"adaptive_simpson","step_rule":"curvature_medium_wall",

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

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

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


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


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

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


X. 安全与完整性


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

工程映射:参见本卷 I40-* 清单(第 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/