From 3970864bebcc56e80f32ba3b02fd75b04cfbee62 Mon Sep 17 00:00:00 2001 From: Alexander Hermann Date: Fri, 7 Aug 2026 16:08:15 +0200 Subject: [PATCH] Remove two fabricated 4C input keys from the released knowledge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `main` currently serves, for SPH: "needs": [... DYN_VISCOSITY, BULK_MODULUS, SOUNDSPEED] "pitfalls": ["SOUNDSPEED too low -> fluid compresses unrealistically; rule of thumb c >= 10 * v_max", "SMOOTHING_LENGTH too small -> spurious tensile-instability voids; rule of thumb h ~ 1.3 * particle spacing"] Measured against the 4C checkout: `SOUNDSPEED` appears in 0 files of 4C's source and 0 of its 2171 upstream decks. So does `SMOOTHING_LENGTH`. Both were listed beside two real parameters, and one carried a numeric tuning rule — a rule about a key that does not exist. A user following it writes a MATERIALS block 4C refuses to parse. Worse, the message they get, "Failed to match specification in section 'MATERIALS'", is the SAME message a mis-cased real key produces, so it does not tell them which mistake they made. The corrected entry states the absence, names the real material (`MAT_ParticleSPHFluid`, 2 source files and 60 decks), quotes the actual diagnostic, and points at `4C -p`, which dumps the accepted grammar from the binary and is the only way to tell a typo from a fabrication. This is deliberately a MINIMAL fix — one file, 21 insertions, 11 deletions — so it can be reviewed in minutes and land ahead of the large consolidation in PR #50. The fabrications have been reachable in the DOI-badged release the whole time the fix sat on an unmerged branch. Note where this text lived: the reference-stub catalog, not a `get_knowledge()` row. A knowledge-level scan does not reach it, which is why it survived earlier audits — but `prepare_simulation` serves it, so a user does. Co-Authored-By: Claude Opus 5 (1M context) --- src/backends/fourc/backend.py | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/backends/fourc/backend.py b/src/backends/fourc/backend.py index 3bbe457b..0e6186c2 100644 --- a/src/backends/fourc/backend.py +++ b/src/backends/fourc/backend.py @@ -480,23 +480,33 @@ def _reference_stub_template(self, physics: str, "summary": ("SPH dam-break: 2D rectangular " "column of fluid collapsing onto a " "rigid floor under gravity."), - "needs": ["MAT_PARTICLE with SPH_FLUID " - "particle type (density, " - "DYN_VISCOSITY, BULK_MODULUS, " - "SOUNDSPEED)", + "needs": ["MAT_ParticleSPHFluid (the material " + "name is case-sensitive and appears " + "in 60 upstream decks)", "PARTICLE_PHASE for the fluid " "column + a boundaryphase for the " "floor/walls", "PARTICLE DYNAMIC with explicit " "time integration + appropriate " "CFL"], - "pitfalls": ["SOUNDSPEED too low → fluid " - "compresses unrealistically; " - "rule of thumb c >= 10 * v_max", - "SMOOTHING_LENGTH too small → " - "spurious tensile-instability " - "voids; rule of thumb h ~ 1.3 * " - "particle spacing"], + "pitfalls": ["[Input] There is no SOUNDSPEED key " + "and no SMOOTHING_LENGTH key in 4C's " + "SPH input. Both were previously " + "served here as required material " + "parameters, one with a numeric " + "tuning rule; neither appears in any " + "file of 4C's source or in any of " + "its 2171 upstream decks. Signal: " + "writing either into MATERIALS " + "aborts with \"Failed to match " + "specification in section " + "'MATERIALS'\" — the same message a " + "mis-cased real key produces, so the " + "message alone does not tell you " + "which mistake you made. Check names " + "against `4C -p`, which dumps the " + "accepted grammar from the binary. " + "(Verified 2026-08-07)"], }, ("porous_media", "terzaghi_2d"): { "problemtype": "Poroelasticity",