URGENT: remove two fabricated 4C input keys from the released knowledge - #52
Merged
Conversation
`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) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR corrects the 4C backend’s reference-stub catalog entry for the SPH dam-break example by removing two fabricated input keys and replacing the guidance with verifiable, solver-grounded instructions. This aligns the served “prepare_simulation” help text with 4C’s actual accepted MATERIALS grammar, reducing the risk that users generate non-parsable decks.
Changes:
- Replaces the SPH dam-break
needsentry to reference the real 4C SPH fluid material (MAT_ParticleSPHFluid) instead of the previously described fabricated parameter set. - Removes the fabricated
SOUNDSPEED/SMOOTHING_LENGTHpitfalls (including the tuning rule) and replaces them with a warning explaining they are not valid 4C keys and how to verify accepted names via4C -p.
alhermann
added a commit
that referenced
this pull request
Aug 9, 2026
Brings the two published hotfixes (#52, #53) onto the consolidation line so the release branch is a superset of what is public. Two conflicts, resolved deliberately: src/backends/kratos/generators/dem.py — took main's side. It carries the OMP_NUM_THREADS clamp added in review of PR #53: omp_threads=0 is not "let OpenMP decide", it is undefined behaviour, and a DEM run reports particle loss silently, so failing early is the kinder outcome. src/backends/fourc/backend.py — took the consolidation side, which deletes a 149-line block of prose "needs/pitfalls" dictionaries that main still carries. This is not a loss: consolidation replaced all six physics entries with input decks that actually run — plasticity_{linear_2d,nonlinear_3d}, porous_media_{terzaghi_2d, consolidation_3d}, particle_pd_impact and particle_sph_dambreak — each checked present before the block was dropped. Verified after resolution: no conflict markers survive; the thread clamp is present; and none of SOUNDSPEED, SMOOTHING_LENGTH, PARTICLE_FRICTION or DEM_timestep_safety_factor appears anywhere as a positive assertion. Every remaining mention is a warning that the key does not exist, which is the knowledge the hotfixes were written to add. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One file, 21 insertions, 11 deletions. Deliberately minimal so it can land ahead of the large consolidation in #50.
What
mainserves todayMeasured against the 4C checkout:
SOUNDSPEEDSMOOTHING_LENGTHMAT_ParticleSPHFluid(the real material)Two invented keys, listed beside two real ones, one carrying a numeric tuning rule — a rule about a parameter that does not exist. A user who follows it writes a MATERIALS block 4C refuses to parse.
And the diagnostic they get,
Failed to match specification in section 'MATERIALS', is the same message a mis-cased real key produces. So the error does not tell them which mistake they made. That is why the corrected entry points at4C -p, which dumps the accepted grammar from the binary and is the only reliable way to tell a typo from a fabrication.Why this is separate from #50
#50 fixes this among ~2,900 other files and cannot be reviewed quickly — Copilot declined it for exceeding 300 files. Meanwhile these fabrications are live in the DOI-badged release (
10.5281/zenodo.20543501), reachable by anyone who clones or cites it, and have been for the whole time the fix sat on a branch.Where it was hiding, which is the interesting part
The text lives in the reference-stub catalog, not in a
get_knowledge()row. A knowledge-level scan does not reach it — which is why it survived earlier audits — butprepare_simulationserves it, so a user does. Any future audit of served content needs to cover this path.Verified
fourcbackend still loads, 48 physics rows intact./home/alexander/4Cdirectly.Still outstanding on
mainafter thissrc/backends/kratos/generators/dem.pywritesPARTICLE_FRICTIONinto every generated DEM deck. That key is absent even from the full 28-application Kratos build; the real keys areSTATIC_FRICTION/DYNAMIC_FRICTION, per contact pair. It is not fixed by #50 either — #50 documents it in a warning while the template still emits it, the same contradiction this PR fixes forSOUNDSPEED. A proper generator rewrite is in progress; it needs a schema change, not a text edit, which is why it is not bundled here.