Implement Gre24 reproduction and freeze v5 preparation evidence

This commit is contained in:
Frank14f committed 2026-11-15 23:28:33 +08:00
1 parent baf2ac8145
commit 8409910b1e
49 files changed
+30910

No files matched your search

@@ -0,0 +1,47 @@
# Gre24 faithful reproduction: specification and plan (Claude, 2026-11-15 night)
Source: Greif, Lechner, Meyer, Composites Part A 185 (2024) 108340, author PDF from OPUS docId 113920, full text extracted locally with pypdf (scratch_pdf/gre24.txt). Section, equation and table numbers refer to the paper. R2-G24 in S2 was an approximation and is not this reproduction. The frozen S2/S3 results stay unchanged.
## 1. Method as published (status: S = specified, A = ambiguous, M = missing)
| Item | Paper | Status |
|---|---|---|
| Data | Autodesk Moldflow simulations of 629 random ABC geometries; one random gate; PP GF30; automatic flow. Dataset DOI in footnote 1: **10.5281/zenodo.10027027** (v4 era); "Data will be made available on request" | S. Check whether the v4 record is downloadable |
| Mesh | Reuses the Moldflow tet mesh; all nodes | S |
| Distances (Table 1, eq. 5) | Eikonal on the tet mesh with **fim-python (tetFIM, Fu et al.)**, phi0 = 0. D_w: f = 1, source = wall boundary. D_i: f = 1, source = gate. D_f: **f = D_w**, source = gate | S. Gate source set (node or face) is A |
| Normalisation (eq. 8) | D*_w = D_w/max D_w, D*_i = D_i/max D_i, D*_f = D_f/max D_f | S |
| Relative flow volume (eq. 10) | V*_f(c) = vol{D_f < c}/vol(Omega), evaluated at each node's own D_f | Discretisation (nodal lumped vs element volume, ties) is A |
| Gradients (eq. 11) | Normalised gradient direction grad/norm of V*_f, D*_i, D*_w | How nodal gradients are formed on tets is A |
| Spatial moment (eqs. 6-7) | S_i = sum_j (v_j/V_i) d_ij outer d_ij over cell centres j with distance to x_i < R **and** abs(D_i(x_j) - D_i(x_i)) < R; R = 3 h_max (longest edge in the mesh); scikit-learn BallTree | S. D_i at cell centres is A; component layout is A (6 unique) |
| Feature tuple (eq. 12) | X* = (V*_f, grad*V*_f, D*_i, grad*D*_i, D_w, D*_w, grad*D*_w, S); D_w enters un-normalised as well | S (about 19 columns) |
| Target / denormalisation (eq. 17) | t*_fill = t_fill V-dot / V; t_fill = (V/V-dot) t* with the applied flow rate V-dot | A for us: does v4/v5 carry V-dot, and does V/V-dot equal our t_set? |
| Naive model (3.3.1) | t*_fill = V*_f | S |
| GBRT (3.3.3, 4) | **XGBoost**, 100 trees, max depth 8, learning rate 0.1, MSE | S. Other XGBoost parameters are library defaults, A |
| FNN (3.3.2, 4) | 4 hidden layers x 100, ReLU, Adam lr 1e-3, batch 1024 node pairs, MSE, PyTorch | Epochs / early stopping are M |
| Multi-output | Y* = (t*_fill, t*_cool, S*_vol, A); the paper trains on all of them | We reproduce fill time only. Single-output versus joint training is A for the FNN |
| Protocol (4.1) | 5 random splits, 315 test / 314 train geometries; RRMSE per test geometry over every node; curves averaged over the 5 splits | S. The **RRMSE normaliser is not defined: A** |
| Published targets | Table C.5 FNN(100,4,ReLU): t_fill RRMSE median **0.0339**, min 0.0130, max 0.2565. Table C.6 GBRT(100,8): median **0.0338**, min 0.0082, max 0.2550. Text: 300 of 314 test geometries well below 0.1; ML only slightly better than naive (Fig. 6, naive median not tabulated) | S |
| Code | None found in the paper; fim-python is public | M. Grok to search |
## 2. Plan (tonight; CPU, plus a GPU only for the FNN if useful)
- **R0 (Grok, 30 min, read-only).** Is the Zenodo 10027027 record public, how large, and what fields (V-dot or flow rate, gate)? fim-python version and tetFIM API (gate as node set or faces). Any author code (GitHub/GitLab, Greif or Meyer, "eikonal injection molding").
- **R1 (Mold, paper only, before any run).** Fix the ambiguous items with one choice each, recorded:
- V*_f measure: lumped nodal volume, strict "<", ties reported;
- nodal gradient: volume-weighted average of P1 element gradients;
- D_i at cell centres: mean of the vertex values;
- S: 6 unique components;
- RRMSE primary = RMSE / RMS(y) per geometry; also report RMSE / max(y) and RMSE / mean(y) as secondary, because the paper does not define it;
- analytic synthetic checks from Fig. 4: on a rod V*_f is linear in D_f; on a centre-gated disk it is quadratic.
- **R2 (MeltAstra, implementation).** Pinned project venv with fim-python, xgboost and scikit-learn (record the versions); feature pipeline per section 1 plus Mold's choices; synthetic tests first.
- Data: v4 (10027027) if downloadable at a reasonable size, otherwise v5 (624 parts, flagged as a version deviation).
- Target: t* = t_fill V-dot/V if V-dot is available, otherwise t_fill/t_set, flagged.
- **R3 (MeltAstra, run).** The paper protocol: 5 random 315/314 splits (seed fixed and recorded), naive + GBRT + FNN, per-geometry RRMSE over **all nodes**, and min/median/max over the 5 splits. Budget: up to 40 worker CPU-h and up to 2 GPU-h tonight; per-part guards as before; failures kept.
- **Fidelity is the core criterion (TRON clarification).** The reproduction is judged by how closely method and protocol match the paper. The published numbers are a *diagnostic reference for deviations*, not a validation gate. Landing inside the ranges below does not by itself prove a faithful reproduction, and landing outside does not refute one. The report keeps three lists separate: (1) paper facts, (2) our implementation choices for ambiguous items, (3) items that cannot be reproduced (missing or unavailable).
- **Numeric reference ranges (fixed now, before any result, diagnostic only):**
- GBRT and FNN fill-time median RRMSE (primary normaliser) in [0.028, 0.040], around the published 0.034;
- the naive model is within about 25 % of GBRT's median (the paper's "ML only slightly better than naive");
- the max stays in the same regime (0.2 to 0.3).
- Anything outside these is reported as a deviation with its likely cause (data version, RRMSE normaliser, target scaling), not tuned away.
- **R4 (after R3, possibly tomorrow).** The same method on our grouped 617/209 protocol and S2 query domain. Compare against R2-G24 and the S2 B0, both at the paper's per-geometry RRMSE and at our component-mean relative L2. Attribution must change one factor at a time, because R4 otherwise changes distance, features and protocol together. Step (a): naive V*_f with eikonal D_f versus naive V*_f with our tet-edge Dijkstra D_f, with the same V*_f measure, roster, query domain and metric. That isolates the distance construction. Step (b): naive versus GBRT on the eikonal features (the value of the features and the model). Step (c): R2-G24 versus the Gre24 GBRT. No step's difference is attributed to a factor it did not isolate.
## 3. Note on a result that matters
Gre24 reports that its learned models are **only slightly better than the naive V*_f model** on fill time. In our S2, R2 (7.30 %) is well ahead of our Dijkstra B0 (10.40 %). If the faithful eikonal naive model closes most of that gap, then our B0 was mostly a weak distance construction, and the remaining public fill-time problem is smaller than S2 suggested.
@@ -0,0 +1,54 @@
# Gre24 填充时间复现 · R1 数学实现规格
2026-11-15,MoldAstra。核读 Greif、Lechner、Meyer (2024) §2、§3.1–3.4、§4.1、附录 C/D;对照 Claude 规格 9783a338。本件固定数学定义、补充选择与适用范围,交 Claude 主审、Melt 实现。尚无本轮合成或训练结果。
## 1 表 1 与式 (5) 的三个距离场
**原文。** 在制件域 Ω 内求 |∇φ|=1/f,在指定源边界 φ=0。D_w 从壁面 Γ_w 出发,速度 1;D_i 从浇口 Γ_i 出发,速度 1;D_f 从同一浇口出发,速度取未归一化的 D_w。路径须留在制件内部。作者在一次四面体网格上使用 fim-python 的 tetFIM,局部更新允许穿过单元面,而非只沿原始棱边行进。门以外的外表面不再设为 D_i/D_f 的零源。式 (8) 的归一化均按单件全域最大值。
**求解器接口。** fim-python 解 ∇φᵀD∇φ=1,传入每单元一个张量。等方速度 f_K 对应 D_K=f_K²I;常速 1 对应 I。公开 API 的源参数是离散节点及其源值。Greif 没有给出程序提交、求解精度、停止容差、源节点复原方式、单元速度插值或壁上零速处理。固定实际采用的库版本、精度和停止条件,连同单位和节点 ID 写入产物。
**R1 补充选择。**
- 有明确浇口面/节点标记时按该标记取源并集;只有坐标时取最近的保留 tet 顶点,等距按原始 ID 升序,记录映射距离及单位。壁面优先用实际壁标记;无标记时,以只出现一次的外三角面代理,记录是否包含浇口。不要因一个表面门点而任意剔除周围整圈三角面。
- 在线性 tet K 内令 f_K 为四个节点 D_w 的均值,再平方。四顶点全为壁点时均值可能为 0,而非退化单元仍有内部体积。该情形以重心到上述壁三角集的最短欧氏距离给出正的单元代表速度,记录触发的单元数、体积占比和最小速度。若仍非正、非有限或源无法传播,则记录原因。该重心处理属于本项目的可复现补充;作者是否做过同样处理未知。不要把节点零值全局替换成常数。连续理想模型在壁附近 f=D_w 可退化,离散单元得到有限值不构成连续壁上旅行时间精确复原的证明。
- 对退化网格、非有限场或未到达点核查身份并报告。按式 (8) 遇到整件某个距离最大值等于零时,原公式无定义;该件在依赖此列的结果单列,不能以掩码删除这些节点后声称全域匹配。非负距离应保留物理长度单位;D_f 是传播顺序代理,不具备独立的注塑秒制。
## 2 体积分位、节点梯度、空间矩
**原文。** 式 (9) 的等值集明确使用严格小于,式 (10) 是等值集占整件的几何体积。式 (11) 指梯度方向,即梯度除以其模。式 (6) 以单元重心方向的单位向量外积作体积平均;式 (7) 同时要求重心欧氏距离与注射距离差的绝对值严格小于 R。R=3h_max,h_max 是该件网格最长单元边。作者用 BallTree 找候选,几何筛选是定义的一部分。
**R1 离散定义。** V=Σ_K v_K,节点容量 m_i=Σ_{K含i}v_K/4。对节点 i 取
F_i = Σ_j m_j 1[D_f(j) < D_f(i)] / V .
比较同一缓存的原 D_f;最大值为正时与以 D_f/max(D_f) 作相同排序在精确算术下等价。全部保留 tet 节点参加,包括壁节点;相同值共享相同分位,记录并列质量。最大节点分位可小于 1。集总积分是我们选的单元顶点求积,并不等于对 P1 场严格切割每个四面体后做精确体积积分。也不等于按节点个数计算经验分位。Naive 模型按 §3.3.1 输出 t*=F。
对 u∈{F,D_i*,D_w*} 先求每个单元的 P1 梯度 g_K:以三条顶点差为行的矩阵 E,解 E g_K=(u_1−u_0,u_2−u_0,u_3−u_0)ᵀ。再求节点 g_i=Σ_{K含i}v_K g_K/Σ_{K含i}v_K,最后归一为方向。不能先把每个 g_K 单位化再平均。模确为零时输出零向量并计数。若实现需要数值零容差,应在看真实评分前记录规则。原文未指定节点梯度重构或零方向约定。
对空间矩用重心 x̄_K 与 P1 重心值 D_i(x̄_K)=Σ_{a∈K}D_i(a)/4;严格双筛选后保留 x̄_K≠x_i 的单元,以筛后总体积重新归一化。d=(x̄_K−x_i)/‖x̄_K−x_i‖,S_i=Σ v_K ddᵀ/Σ v_K。非空时 S 对称半正定、迹为 1;空邻域应报告。六列顺序固定 xx,xy,xz,yy,yz,zz,不作剪切缩放。重心处 D_i 的插值、重合中心处理、六列布局均为补充选择。
式 (12) 对应 19 列:F(1)、其方向(3)、D_i*(1)、其方向(3)、原 D_w(1)、D_w*(1)、其方向(3)、S(6)。D_f 用于构建 F,不另入列;t_set 也不是式 (12) 的输入特征。附录 B 冷却时间拟合的尺度不要替代此处式 (7) 的特征半径。
## 3 秒制和 RRMSE
**原文。** 式 (17) 为 T=(V/Q)t*,Q 是施加在该件浇口的体积流量,V 是整件体积。§4.1 对每个测试几何的全部节点评分,计算相对均方根误差 RRMSE。§4.1、图 6 和表 C.5/C.6 没有给出可唯一识别分母的公式。不能用表中数字反推作者采用了哪个定义。
**复现选择。** 优先用可核单位和来源的施加 Q,和同单位 V 组成秒尺度;条件是 Q>0。没有可靠 Q 时按 Claude 规格用求解前设定的 t_set 秒,记录来源、替代件数和相应数据版本,通过 T/t_set 训练并乘回秒。不要由真实到达终点反拟合 Q,也不把打印的 0.000 当作已知流量。各模型在同一件上统一目标和秒尺度。对同一预测/真值同比例换单位时,下述相对分数不变;改动训练尺度仍可改变拟合模型。
令 y 是单件全 tet 节点的真值,ŷ 是同一节点预测,N 是节点数。e=√[Σ(ŷ_i−y_i)²/N]。主 RRMSE_RMS=e/√(Σy_i²/N)=‖ŷ−y‖₂/‖y‖₂;同时报 e/max(y) 与 e/mean(y)。三者均用节点等权;不使用体积权、不做逐点相对误差平均。零分母则该指标 NA 并记录,不能加 ε 或按结果挑分母。原 VTU 若存在 tet 域外辅助节点,保留 ID 对照、域外数量及标签状态;不能静默缩成 S2 查询域。
**聚合。** §4.1 明确 629 几何,五次随机拆分,每次 315 测试、314 训练。它们可重叠,不是五折交叉验证。每个 split 先得到逐件误差,再独立取 min/median/max;附录 C 表逐项平均这五组三统计。图 6 表示各 split 内先排序,再逐秩平均。保留逐 split 名单、实际几何数、逐件指标及失败;分割随机种子未给出。论文后文个别“314 个测试件”的叙述与 §4.1 不一致,以方法段为协议。若实际只能使用 624 件数据,可另报等分 312/312,标为版本及件数偏差,不伪称做到了 315+314。来源:论文脚注 DOI 与确切版本的对应,以 R0 下载核对为准。
FNN 原文四层、每层 100、ReLU、Adam、lr=0.001、batch=1024、MSE;GBRT 是 XGBoost,100 棵、深度 8、lr=0.1。本文只核填充时间;完整原训练轮数、精确 seed、模型版本及填充单目标与原多输出训练的等价性均未知。表 C.5 的填充 min/median/max=0.0130/0.0339/0.2565,C.6=0.0082/0.0338/0.2550。它们是偏差诊断参照。方法、数据、协议以及未确定项的如实记录决定复现忠实度。
## 4 实现可直接使用的解析检查
1. 平面入口、常速 c、平直长方体:φ=x/c,源面 φ=0。用 c=2 可识别把速度张量误写成 cI 或 I/c²。杆取理想轴向顺序 x,连续分位为 x/L;中心浇口等厚圆盘取径向顺序 r,连续分位为 (r/R)²。图 4 的形状关系用于检验体积映射;一般三维 f=D_w、有限网格、集总与并列不会逐点精确等于这两式。用解析顺序检 CDF,另用常速场检求解器,两项独立。
2. 单个 tet 的 4 个节点容量相同,顺序分数取 (0,1,1,2),严格 F 应为 (0,1/4,1/4,3/4)。连续 P1 半空间切割不必得到同样的结果。多单元不等体积网格应按 m_i 算。
3. 仿射 u=a·x+b 时 P1 单元和节点梯度均应复得 a;常数场给零方向。对任意非空单元集,空间矩迹为 1;共同旋转网格与方向时,S 应按 R S Rᵀ 变换。
4. 给 y=(1,3)、ŷ=(2,3),三种相对误差依次为 1/√10、1/(3√2)、1/(2√2)。可在读模型输出前锁定分母选择及标签。
**R4 单因素边界。** 若要归因 tetFIM 对 Dijkstra 的贡献,固定同件、同门源、同壁几何与 D_w 速度信息、同 F 求积、同钟、同评价节点/权重、同划分和同模型,并注明节点速度到单元/棱边的对应。若使用各方法原有的不同 D_w 构造,只能归为整体距离构造差异。Naive→GBRT 同时改变输入和学习方式时估计组合增量。绝不把协议、特征、模型一起更换后的差距归给 Dijkstra。
**原始来源。** [Greif 等作者 PDF](https://opus.bibliothek.uni-augsburg.de/opus4/files/113920/113920.pdf) · [期刊 DOI](https://doi.org/10.1016/j.compositesa.2024.108340) · [fim-python 方法论文](https://doi.org/10.21105/joss.03641) · [fim-python 接口](https://fim-python.readthedocs.io/en/latest/interface.html) · [Claude 复现规格 9783a338](https://gitea.frank14f.online/Frank14f/MeltMind/src/commit/9783a338/docs/claude/gre24-reproduction-spec-2026-11-15.md)