diff --git a/docs/claude/README.md b/docs/claude/README.md new file mode 100644 index 000000000..5951847fb --- /dev/null +++ b/docs/claude/README.md @@ -0,0 +1,29 @@ +# Claude design and review record (MeltMind) + +Branch `claude/design-record-20261114`. Review material; not a release and not for main. + +## Contents +- `design-state-2026-11-14.md`: the current consolidated design state. Covers frozen rules, decisions, the S1 result review and open items, each with the source thread or commit. +- `../../tools/greif_census/`: stdlib-only Greif v5 ZIP range-read census (624 log rows) plus scripts. + - Source data: Meyer & Greif, Zenodo 10.5281/zenodo.18598121, CC BY 4.0. ABC dataset terms apply separately. + - The VTU node counts later superseded the LOG node counts for geometry; see the design state, §1. + +## Full documents (Drive, MeltMind workspace folder 1quVPlAkM8lK95siVoA0YQ23I9I-0kch3) +The Drive copies are kept as the original versions. The summaries in this branch do not replace them. + +| Document | Drive file ID | +|---|---| +| Research proposal v2 | 16LoI7ztGV55W4rBcuJEGx3pH16YU2AFH | +| Proposal v2.1 addendum (industrial SoA, decision table) | 1EdAhFr6gn3R-hlLDqqpRYD8--1mWtZBM | +| H1 comparison design v0 | 1b1175XqWBbSW3_tXSTdjQfzfS9n467Wj | +| H1 design v0.1 addendum | 1RkVXSLohnU54Ut42ktN_7V1kDuOfeldw | +| Data contract v0 | 11TyzZVo7KfB1TIKQwjwW5bVYOLF_wcQD | +| P0 acceptance criteria and task list v1 | 1X3VEQVwhTEoskrJxz3YShg2PwmkVwkxP | +| Reference code manifest v1.1 | 1uFkNKDYiQAxIhRu4P7DGx3jzgCLLvpfU | +| Greif v5 census, Appendix A | 1Q0lEk9aDU6sPWZvpKGvRJ_jZQAHVJWRq | +| Review of Horsea package ebad883f | 1o-7sSolzY3b6wf6yrPe-Jrn-2_fvCwVc | + +MoldAstra's frozen specs (on Drive): +- O2-rep v1.1: 1VJAADNvR5Bps8UBFqg2ATCgSLYzFQfnK +- O2-rep v1.1a supplement: 1eGrFT8_VDoE_nEQ-Z8n1WymfpukdxPN5 +- S1/M2 including the v1.2 sampled header: 1LDZBY2n2OrL2ipnH18wyZLJgV72rqhPd diff --git a/docs/claude/design-state-2026-11-14.md b/docs/claude/design-state-2026-11-14.md new file mode 100644 index 000000000..9887d8cb5 --- /dev/null +++ b/docs/claude/design-state-2026-11-14.md @@ -0,0 +1,113 @@ +# MeltMind design state: consolidated record (Claude, 2026-11-14) + +Sources: Slack C0C78UFKGRM thread 1794219487.255049 (2026-11-09 to 2026-11-14), the MeltMind codex/* review branches named below, and the Drive documents listed in README.md. This file summarises; where it differs from a frozen source, the source wins. + +## 0. Goal and scope +- **Goal:** a practically useful filling surrogate for unseen parts. Geometry organisation is a means toward cross-part generalisation and sample efficiency, not a goal in itself. Inference speed is secondary. +- **Labels:** 3D Moldflow labels (Greif v5). Physical reduction (Hele-Shaw) is not the target. +- **Two exploratory candidates:** + - O1: type-aligned grouping/aggregation. + - O2: local geometric tensor representation, the continuous form of "local frames". +- **Other routes, kept as references and baselines:** + - R1: strong whole-part models; + - R2: Gre24-style distance/eikonal features with GBRT; + - R3: in-house 2.5D solve plus learned 3D correction; + - R4: explicit global pressure coupling. +- **Topology/local-type partitioning (O1) remains an independent candidate.** The S1 node-representation result does not count against it. +- **Public data limits:** Greif v5 has one material, one random gate per part and an automatic process. It cannot identify gate, process or material interventions, short shots, or reconnection effects; those wait for the in-house CAE. + +## 1. Data contract (Greif v5 on Horsea) +- data.zip is 32,757,812,726 bytes, official MD5 verified. 624 parts; 249 filename source keys (a leak-prevention key, not verified independent CAD families). +- **Geometry** comes from the VTU tet subdomain. + - 617 parts are pure tet. 7 are mixed (triangles plus tets): the triangles carry no field values, are not a coincident surface, and in 00001048 form a separate second body. They are kept as an auxiliary component, flagged `mixed_topology`, and are not part of the d(x) wall. +- **Units, by numerical cross-check only:** Points in mm, Fill_time in s, Pressure in Pa, Temperature in K. Velocity unit unknown, so velocity is unused. +- **Frames** are joined by physical time, never by block number. Masks are F (Fill_time <= t), V (finite) and M = F AND V. No nan_to_num. Missing-value age varies, so no fixed frame lag applies. +- **First target:** static Fill_time on tet nodes. + +## 2. Descriptors +- **d(x):** exact distance to the tet-subdomain boundary faces. Validated analytically (box, plate, rod) and against brute force. It is exact only for the given triangulation; 2d is not thickness. +- **t_part** = 4 x the lumped-mass-weighted median of d over all tet nodes, including d = 0. This is a scale proxy. R = 2.5 t_part. +- **O2-A (analytic rod):** the in-plane split shrinks at first order with transverse refinement and flips sign with a mirrored tet split. This is directional discretisation bias that converges. It is not established on real parts under remeshing. +- **E6 (three real parts):** a four-point kernel compared with the old 3-hop field. Part 778's near-cut share rose from 25.9 % to 40.05 %. Hard type labels are therefore ill-posed near degenerate spectra. + +## 3. O2 representation (frozen O2-rep v1.1a, MoldAstra spec; implemented at codex/o2-rep-v1-1a f2e5ed0) +- mu = lambda+/tau+; g12 = mu1 - mu2, g23 = mu2 - mu3. +- B_k = (mu_k - mu_{k+1}) (P_1 + ... + P_k). Continuous at repeated eigenvalues and adds no information beyond M/tau. +- Edge and gate readings q(u) = (u^T B1 u, u^T B2 u). Edge readings are mesh-edge features (rigid-motion invariant, not remesh invariant). +- **FP64 constants:** + - tau_min = 1e-10; + - eps_psd = 1e-12 tau0 (clip small negative eigenvalues, then renormalise); + - edge length tolerance 1e-12 L_med; + - gate tolerance 1e-6 L_med. +- `clipped` is an audit flag only, never a model input. + +## 4. O1 (type grouping) status: not frozen +- **Admission rule O1-v1:** + - J = all regions after V/512 cleaning; + - K = max(ceil(V/min V_j), 8); + - admit only if K <= 512 and N/K >= 200; + - mixed mode, no region quotas. +- The screen used the old 3-hop type field and covered 3 parts only. One part was admitted (666); 778 and 850 failed on nodes per group. +- **Decided order:** + 1. O1 type definition and any merge/admission change, frozen after E6; + 2. calibrate every stage on part 890 plus one uncached part; + 3. checkpointed region tables for a panel; + 4. exact capacity LP (basic solution, identical in every arm) on admitted parts. +- O1-v2 (tying cleaning to the resolution floor) was not adopted. +- Partition matching must be verified, not assumed: K, connectivity, volume within the tolerance, and pool-level shape and boundary-fraction tests. + +## 5. S1: model-free coverage diagnostic (M2 v1.2 sampled) +- **Panel:** 24 parts, one per source group, from node-count tertiles (seed 20261114). Folds: LOPO-24. Commits: codex/s1-panel-precheck 81f56af, codex/s1-sampled-draw 94011fd. +- **Sampling:** 2,000 mass-PPS draws per part, with replacement (seed [2026111400, prefix]), on d > 0 nodes. + - Mid-rank weights (1/P) c E / K_pE. + - k = 8 distinct physical neighbours; D_p = RMS over p. + - Ratio estimators over draw counts. +- **Arms:** + - A: d/t, gate distance / R_g. + - B: A plus g12, g23, gate q1, gate q2. + - C: B plus edge mean/max of q1 and q2. + - Controls: A+S (whole-block shuffle of the B columns), B + plain edge shuffle, B + zero-pattern-stratified normalised shuffle (secondary, not a gate). +- **Seeds:** permutations 1401-1405; query bootstrap 1406 (200 replicates); source bootstrap 1407 (2,000 replicates). +- **Decision:** the five-seed mean source-level interval. That interval is a source-reweighting interval over fixed LOPO paired differences, not a coverage guarantee for new sources. +- **Result (codex/s1-real-scoring 90b8c66; five-seed means, rank-distance units):** + +| Contrast | Difference | Interval | Reading | +|---|---|---|---| +| B - (A+S), whole | +0.0026 | [+0.0014, +0.0041] | behind (about +5 % of A+S) | +| B - (A+S), near-wall | +0.0017 | [+0.0004, +0.0032] | behind | +| C - plain edge shuffle | -0.0150 | [-0.0162, -0.0138] | ahead, but 86 % of plain-shuffle slots break the algebraic bounds | +| C - stratified shuffle (secondary) | -0.00055 | [-0.0009, -0.0002] | ahead, about 1 % | + +All five seeds point the same way for every contrast. Cross-dimension contrasts are descriptive only. + +- **Reading:** + - No support for O2 node invariants on input coverage. + - The edge-direction readings carry a small amount of extra source-transferable joint structure. + - S1 ranks candidates and does not refute them. Nothing here concerns prediction. + +## 6. Rules carried forward +- **One factor per comparison;** identical descriptors in every arm; a matched generic partition plus a control cut for O1; cost-accounted distance baselines are always reported. +- **Decision table for S2 learning curves.** Margin m is a candidate 10 %. With interval [L, U]: + +| Region | Outcome | +|---|---| +| U < 0 | harmful | +| L <= 0 <= U < m | no meaningful gain | +| L <= 0, U >= m | insufficient evidence | +| 0 < L, U < m | positive but below margin | +| 0 < L <= m <= U | positive, size undetermined | +| L > m | meaningful gain | + +Single-seed results are exploratory only. +- **Process:** + - fixed-commit packages; + - supervision of 30 min / 1.25 GiB per field; + - the 5e8 visit count is an alarm only; + - over-budget parts are listed, never silently replaced; + - no post-hoc tuning of thresholds; + - no training without an explicit go from Yanqi. + +## 7. Open (as of 2026-11-14 16:30 CST) +- Yanqi's decision on O2 continuation and S2 scope. Recommendation: build the S2 baseline stack (R1 + B0/R2) first, and keep only the O2 edge readings as one feature group. +- O1 type definition and region-table preparation (see §4). +- Velocity units and the export path have no written source. diff --git a/tools/greif_census/README.txt b/tools/greif_census/README.txt new file mode 100644 index 000000000..797f35e67 --- /dev/null +++ b/tools/greif_census/README.txt @@ -0,0 +1,4 @@ +Greif v5 log census (ClaudeWorker, 2026-11-11) +Source data: Meyer & Greif, "Injection Molding Simulations", Zenodo v5, DOI 10.5281/zenodo.18598121, CC BY 4.0 (geometries from the ABC dataset; ABC terms apply separately). +Method: HTTP Range reads of data.zip (32,757,812,726 bytes); central directory parse; raw-inflate of each of 624 .log entries. No full download. See Drive Appendix A (1Q0lEk9aDU6sPWZvpKGvRJ_jZQAHVJWRq). +Files: greif_v5_log_census.csv (624 rows; derived facts from Moldflow logs), cd.py/cd2.py (central directory stats/grouping), list.py (log offsets), parse.py (summary stats), csv.py (census CSV), grp.py (group histogram). Python stdlib only; run with python3 -I on untrusted inputs. diff --git a/tools/greif_census/SHA256SUMS b/tools/greif_census/SHA256SUMS new file mode 100644 index 000000000..8dd8095a2 --- /dev/null +++ b/tools/greif_census/SHA256SUMS @@ -0,0 +1,8 @@ +18ddf9dbbb00337a80177d960128becb099158b783e8c6f934a3e262a7645136 cd.py +bce644a6856b24bd31b1e360ec1ea7aafe4a1741b5ea49ac68fd043d4fa8c36a cd2.py +c264eeb2c1c15576a6696d8c244310dda1d145ac5ec285bb5093f4cba434ddbf csv.py +48ba5438fe571cd9f91f37656e7a349cfc09874b7bec85163879f67842a1ff04 grp.py +4faca3243208de8dad56b388525a7e1db34eeb9ad9a61800a780c26efa58bd95 list.py +09bd59d7fb938f044fb1f020e1684690e356cb0bce7ee02ca4d8227615816ac8 parse.py +d5ab81fb3dfe188b2b7e1fc4a0ae0afcf419e0ac9808d6678478de36a3c94b1a greif_v5_log_census.csv +49284d790357e1682daa9589d5eaec0c26595eb33fdace4cb76d39325783e998 README.txt diff --git a/tools/greif_census/cd.py b/tools/greif_census/cd.py new file mode 100644 index 000000000..9d1b0c7f6 --- /dev/null +++ b/tools/greif_census/cd.py @@ -0,0 +1,33 @@ +import sys,struct,collections +b=open(sys.argv[1],'rb').read() +i=b.rfind(b'PK\x05\x06'); print('eocd at',i) +# zip64 eocd +j=b.rfind(b'PK\x06\x06') +if j>=0: + n=struct.unpack('1',sum(1 for c in h.values() if c>1),'files in multi',sum(c for c in h.values() if c>1)) +for e in ents: + if e[0].endswith('.log') or e[0].endswith('.yml'): + print(e); + if e[0].endswith('.yml'): break diff --git a/tools/greif_census/csv.py b/tools/greif_census/csv.py new file mode 100644 index 000000000..ca215a7a4 --- /dev/null +++ b/tools/greif_census/csv.py @@ -0,0 +1,8 @@ +import sys,os,struct,zlib,re +d=sys.argv[1]; print('file_stem,group_key,part_nodes,elements,volume_m3,inj_pressure_vp_Pa,vol_filled_vp_pct') +for f in sorted(os.listdir(d)): + b=open(os.path.join(d,f),'rb').read(); nl,el=struct.unpack('