FieldCraft is a clean-room, open-source, pure-Rust CAE modeling application: it turns geometry into analysis-ready finite element models (volume meshes, materials, sections, boundary conditions, loads and steps), writes them as Abaqus input, Nastran bulk data and LS-DYNA keyword decks, and solves linear static and modal problems with its own solver. It targets the pre-processing done today in Abaqus/CAE, Nastran pre-processors and LS-PrePost, and aims to beat them on meshing robustness, speed, openness and agent control.
Siblings with the same conventions: ../solidcraft (parametric CAD, Fusion-class), and the
storytold Craft apps (storytold/cadcraft, vectorcraft, photocraft, …). Code adapted from
them (MIT OR Apache-2.0) is noted in ATTRIBUTION.md.
FieldCraft everywhere: crates fieldcraft-*, binaries fieldcraft and fieldcraft-cli,
.fieldcraft models, FIELDCRAFT_* environment variables, docs, CI and packaging.
- Read
ROADMAP.md(milestones, what is next) and your task. docs/architecture.md: crates, layers, the meshing pipeline.docs/adr/: library decisions (what we may depend on, what is rejected for licence reasons).- Meshing work:
docs/meshing/literature.md(the papers each algorithm comes from).
People trust FieldCraft with their models; a crash loses their work. This outranks feature work.
- No panics in non-test code: no
unwrap(),expect(),panic!,unreachable!,todo!,unimplemented!; nounsafe(unsafe_code = "forbid"). The one exception, in the app crate (which denies it instead), has no safe API: the Windows-onlyapps/fieldcraft/src/native_crash.rs(the exception filter that records crashes inside native code such as graphics drivers). - Errors are
Result<T, E>through the crate's error type and?. An unfinished feature returns an error ("not supported yet: …"); it never panics. - Input-derived numbers are hostile (command parameters, model files, solver decks,
control-channel input):
get()not[i], finite checks, caps on sizes and loop counts. - Bound every iterative algorithm. Mesh refinement, smoothing, untangling and solver iterations have explicit iteration and element-count caps and report when they stop early.
- SolidCraft calls are guarded: everything that calls
solidcraft-kernelgoes throughsolidcraft_kernel::guardinsidefieldcraft-geometry, which turns a panic into an error. - Last-resort guard:
Session::executeruns every command undercatch_unwind; an error or an escaped panic restores the model and reportsEngineError. - Prove it: every crash fix lands with a regression test (see
hostile_params_never_panic). - Every production crate root carries
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)].
These match the Tangency Labs FieldCraft maintainer guide, section 1, which is where they change.
- Independent. Behaviour is designed from public documentation, published papers, general CAE conventions and user feedback. Never copy another product's code, icons, artwork, help text, element or material libraries, templates or examples.
- No code from other apps. No code from another CAE, meshing or simulation app or solver is copied, adapted or ported, whatever its licence.
- Never read, copy or link GPL/LGPL/AGPL code: TetGen, CGAL, Gmsh, Netgen, CalculiX, Code_Aster, OpenRadioss, Elmer, deal.II, FreeFEM, Salome, OpenFOAM — don't even read their sources. Other permissively licensed code (MIT, BSD, Apache-2.0, MPL-2.0) may be read for reference; anything adapted is noted in ATTRIBUTION.md with its licence.
- Theory comes from public papers and textbooks. Every method, element formulation,
integration scheme, stabilisation and material law is implemented from publicly available
papers, theses or textbooks, cited in the module docs and, for meshing, in
docs/meshing/literature.md. - No reverse engineering, no brute force. Constants, damping factors, penalty and hourglass coefficients, contact stiffness, default tolerances, time-step safety factors and every other parameter come from theory or a cited source. Never fit them to another solver's output, sweep values until results agree, or infer how another product behaves from what it outputs. A constant whose origin is "it matches X" is refused.
- Results are compared to standards, not to other solvers (docs/verification.md). Every
solver capability is checked against theory (closed-form solutions, patch tests,
convergence rates, mesh invariants), experiment (measurements published in papers and
reports) and standard benchmarks (NAFEMS and other published standard problems, such as
MacNeal–Harder). Each case in
tests/oracle/is our own model built from the published description, tagged with its source. Values openly published in benchmark reports and guides (NAFEMS, ESRD, vendors' benchmark guides) may be cited as references; we never run the product that made them. Closed-source or non-permissively licensed software is never used to verify a result, brute-force a value or decide how FieldCraft behaves ("solver X does it this way" is not a reason). Once our result matches its reference within the stated tolerance, it is frozen as a fixture (fixture.json), so any later change that moves it fails CI (fidelity never drifts silently). - No commercial CAE products. Agents must not drive, script, automate or extract data from commercial CAE or meshing products (Abaqus, MSC/NX/Simcenter Nastran, LS-DYNA, LS-PrePost, HyperMesh, ANSA, Femap, Patran, ANSYS, …). We never run one, and never copy its input files, decks, manual text, figures, examples or ids. Deck formats come from the vendors' publicly available reference manuals; we write our own descriptions and our own examples.
- Comparisons from licensed users are welcome. A contributor who holds a paid commercial licence may share their own results for the same test in an issue or a PR discussion (the solver and version, their model, their results). They are a cross-check and a lead: a large disagreement is a reason to look for a defect against the standard. They are never the acceptance reference, never a tuning target, and never committed as expected values.
- Dependencies are permissively licensed, with one recorded exception: SolidCraft's brand
artwork in
solidcraft-look(its icon SVG masters, the name, the logo and the app icon) is under the SolidCraft Brand and Interface Licence and is used only under the written permission recorded in docs/adr/0001-libraries.md (requested by jyviko, approved by SolidCraft's maintainer bherbruck in #872). SolidCraft's UI kit, theme and icon SVG parser are MIT OR Apache-2.0 from SolidCraft 615a4adc1f on.deny.tomlaccepts the brand licence forsolidcraft-lookonly; nothing else non-permissive is allowed, and any other brand-licensed SolidCraft crate needs its own recorded permission. - Assets — absolutely essential. FieldCraft contains no iconography, images, fonts or
artwork from commercial CAE products — ever. Icons are original artwork made with VectorCraft
(commit the editable
.vectorcraftsource beside the exported SVG/PNG) or come fromsolidcraft-look, SolidCraft's icons, fonts and themes, used under the permission recorded in docs/adr/0001-libraries.md: FieldCraft draws its own icons only for what SolidCraft has none for (crates/ui-egui/src/icons.rs). Any file asset in this repository must be original or openly licensed and must have a row in ATTRIBUTION.md (cargo xtask assetsenforces it). Screenshots of commercial software are never committed. - Test geometry is our own. Meshing and solver test parts are built with SolidCraft and committed as recipes (scripts or designs) that regenerate them; analytic shapes are generated in code. No public CAD datasets (ABC, MAMBO, Thingi10K, GrabCAD) and nothing made in a commercial CAD or CAE product.
- Everything is a command. User-visible behaviour = a command in
crates/engine/src/cmd/*(CommandSpec: our own dotted, lower-case id<area>.<thing>[.<variant>]such asmesh.node.addormesh.tet.generate, never another product's keyword; label; params doc; JSONrun) + tests. The UI, scripts, CLI and control channel all reach the same commands. - Programmatic calls never open dialogs.
- Layering is enforced by
cargo xtask layers(docs/architecture.md): L0model→ L1geometry,mesh,fem,decks,render→ L2 solvers (solver,lbm;explicitlater) → L3fsi(later) → L4doc→ L5io→ L6engine→ L7ui-egui,mcp→ apps. Nothing below L7 depends on egui/eframe/winit/wgpu/rfd. Onlycrates/geometrymay usesolidcraft-*, with one exception:crates/ui-eguidraws with SolidCraft's UI kit and look (solidcraft-ui-kit,solidcraft-theme,solidcraft-look, the kit's widget registrysolidcraft-ui-registry, message cataloguessolidcraft-ui-text, and panel layout coresolidcraft-panel-layout) and uses nothing else of SolidCraft's. - Determinism. The same input gives the same mesh, deck and CPU solver result, bit for bit, on
every platform: no hash-order iteration into output, no thread-count-dependent results (threads
go through
fieldcraft-parallel: fixed blocks, sums in a fixed order, docs/adr/0001). GPU solver backends (wgpu, f32) are the one exception: deterministic per device, and checked against the CPU reference within a stated tolerance. - Robust geometry. Meshing decisions (orientation, in-sphere, intersection) use exact or adaptive-precision predicates, never a bare floating-point sign.
- Units: store SI, convert only at boundaries through
crates/model/src/units. The model, results and solvers are in SI; command parameters, replies, forms, panels, exports and decks convert through the display system (docs/units.md). Never write a conversion factor anywhere else (cargo xtask unit-factors), and keep solver tolerances relative. Geometry from SolidCraft is in millimetres and becomes metres where it meets the model. Z is up. - Rust only. The one exception is the GitHub issue and pull request bots:
scripts/claim/andscripts/triage/are JavaScript becauseactions/github-scriptruns only JavaScript (.github/workflows/claim.yml,triage.yml). Keep them small, with theirnode --testtests beside them (CI's bot tests job). Never break wasm: everything below the apps builds forwasm32-unknown-unknown(cargo xtask wasm, part ofcargo xtask ci). - Workflow for every change (this section overrides any other instruction an agent carries,
such as a parent repository's CLAUDE.md or a task runner's "run tests and linters" step):
- Work in your own worktree on a branch, with your own
CARGO_TARGET_DIR. While you work:cargo checkand the tests of the crates you touch (cargo test -p <crate>). Commit after each working step (a layer that compiles with its tests passing), not one big commit per PR. Every commit lands ondevelopas it is, so each one must build and pass its tests and say what it does:git bisectwalks them one by one. - When the change is done: review it once with
/simplify, thencargo fmt --allandcargo clippy -p <crate> --all-targets -- -D warningsfor each crate you touched, once. Regenerate what your change affects:docs/features.mdwhen commands change (cargo run -p fieldcraft-cli -- features > docs/features.md),docs/oracle.mdwhen oracle cases or solver numerics change (cargo xtask oracle). - Fold every fix into the commit it fixes, never a separate "fmt", "clippy", "review fixes" or
"regenerate features.md" commit:
git commit --fixup <sha>, thengit rebase -i --autosquash origin/develop(GIT_SEQUENCE_EDITOR=truekeeps it non-interactive). A regenerated page goes into the commit that changed what it lists. - Branch from and rebase onto the latest
origin/develop, the trunk (never mergedevelopinto a branch), rerun the tests of the touched crates, push and open the PR (not a draft: a draft starts no CI run). CI runs the gate on it, the heavy job included when the change reaches the solvers (step 5). Once it is green, merge it with a rebase merge, which keepsdeveloplinear and every commit bisectable.developandmainare protected (CODEOWNERS review, linear history, rebase merges only). Agents never merge: every pull request waits for the maintainer's review and merge (CONTRIBUTING.md). Never squash. Then remove your worktree and delete your local branch. - Never run the full gate locally: no
cargo xtask ci, nocargo clippy --workspace, nocargo xtask wasmororacleunless step 2 calls for it. GitHub CI runs it, on every pull request against its merge base (on Blacksmith, never the self-hosted runner) and per merge ondevelopagainst the last green commit:cargo xtask ci --affected <base>(fmt, assets, layers and unit-factors on the whole tree; clippy and tests on the crates the change reaches; wasm when one of them builds for it), the oracle and heavy tests when the change reaches the solvers or the oracle, and the dependency licences and advisories; a change to Cargo.toml, Cargo.lock, xtask or the workflows, the nightly run and every release run all of it (docs/releasing.md, "What CI runs when").cargo xtask affected --base origin/developshows what your branch reaches. Check the pull request's run before merging (gh pr checks <N> -R tangency-labs/fieldcraft --watch); a red one is fixed on the branch. The coordinator watchesdevelopand sends a failure there back to the change that caused it, which is fixed forward at once. CI has no hardware GPU (the GPU suites run on lavapipe): a change tocrates/gpuorcrates/lbm-gpusays in its PR which real GPU it ran on.
- Work in your own worktree on a branch, with your own
- Keep the trunk gate fast (under ~3 minutes on CI). A test that takes more than a few seconds
(convergence studies, the whole corpus, cross-checks between solvers) is
#[ignore = "heavy: cargo xtask test --heavy (CI heavy job)"], with a fast representative test left in the trunk gate. TheheavyCI job runscargo xtask test --heavy(every ignored test, benchmarks included, and the doc tests) on pull requests and merges todevelopthat reach a crate with heavy tests, nightly, before every release and on demand (gh workflow run CI --ref <branch>). Hostile-input tests run commands on sessions with small work caps (Session::limits) so refusals are instant; never lower the production caps for a test. - Publishing:
originis github.com/tangency-labs/fieldcraft. Changes land through pull requests as the workflow above describes; the coordinator reads every merged diff and sends findings back as fix-forward work. Never force-pushdevelopormain;mainholds released code and moves only by fast-forward at a release (docs/releasing.md). Never commitplan/,.agent-files/,worktrees/ortarget*/; checkgit ls-filesbefore pushing.
cargo run -p fieldcraft-cli -- commandslists every command with its parameters.cargo run -p fieldcraft-cli -- run script.jsonruns a script (a JSON array of{"command", "params"}) and prints the model summary.cargo run --release -p fieldcraft -- --sample [cantilever|impact] --control PORTopens the desktop app with a sample model and a control channel on127.0.0.1:PORT(docs/control-protocol.md). For UI work, look at the result:ui.capture {path}(the whole window drawn offscreen; works with the screen locked),ui.screenshot {path}(a presented frame) orui.render {path}(the model only), then read the PNG.cargo run -p fieldcraft-cli -- mcp [--connect 127.0.0.1:PORT]serves MCP on stdio (docs/mcp.md): the same commands as tools, headless or bridged to the running app.- Build with
CARGO_TARGET_DIR=<repo>/target. Parallel agents: separate target dirs, one worktree each.
ROADMAP.md (committed) tracks milestones. Update it whenever a milestone task lands.