Experimental Rust geometry preprocessing¶
Experimental: qualify it on your model first
The Rust geometry preprocessor is experimental. It is not a drop-in
replacement for native HEC-RAS preprocessing. Before any production use,
run GeomPreprocessor.validate_rust_equivalence() on your own model and
keep its report. That comparison is the preferred way to qualify the
experimental workflow. A result on one model, engine build or HEC-RAS
version does not qualify another. Equivalent property tables are not a
hydraulic review. The engine and every workflow on this page are
not for regulatory use.
RAS Commander can run an external Rust engine, ras-preprocess, that
computes the 2D flow-area property tables native HEC-RAS 7.0.1 and 7.0.2
write into a geometry HDF. It also provides a harness that runs native preprocessing and
the engine side by side on copies of your model and compares every result.
Both entry points are static methods of GeomPreprocessor. Every call emits
ExperimentalWarning.
| Method | Purpose |
|---|---|
GeomPreprocessor.validate_rust_equivalence(project, geom, work_dir=...) |
Qualification: native and Rust preprocessing on separate copies, compared dataset by dataset, with a JSON and markdown evidence report |
GeomPreprocessor.compute_rust_experimental(geom_hdf, out_path=...) |
Write the engine's products into a copy of a geometry HDF, with provenance |
GeomPreprocessor.run_geometry_preprocessor(plan, engine="rust" \| "auto") |
Preprocess a plan's geometry with the engine in place, or fall back to native (see Select the engine) |
RasCmdr.compute_plan(plan, preprocess_engine="rust" \| "auto") |
Preprocess with the engine, then run the plan with HEC-RAS on those tables |
What the engine computes¶
For every 2D flow area of a complete HEC-RAS 7.0.1 or 7.0.2 geometry HDF, the engine computes the products of the four native preprocessing stages:
- face profiles (
Faces Profile Info/Values) andFacePoints Elevation, from the terrain and its modifications; Cells Center Manning's nand the classification families (Infiltration/...,Percent Impervious/..., sediment bed material);- face area-elevation tables (
Faces Area Elevation Info/Values,Faces Minimum Elevation,Faces Low Elevation Centroid); - cell volume-elevation tables (
Cells Volume Elevation Info/Values,Cells Minimum Elevation,Cells Surface Area).
The 2D stages take the mesh topology, terrain and classification references from the geometry HDF. Use native HEC-RAS to generate the 2D mesh and convert older geometry HDFs.
For HEC-RAS 7.0.2, the engine also computes cross-section hydraulic property
and flow-distribution tables (Geometry/Cross Sections/Property Tables,
Flow Distribution, Geometry/GeomPreprocess/XSEC Properties), reach cells,
and junction cells in 1D-only geometry, including permanent and nonpermanent
ineffective-flow blocks, levees, blocked obstructions and banks on vertical
end walls. With storage areas, lateral structures and SA/SA connections in
that geometry, it also compiles the solver connectivity
(Geometry/GeomPreprocess/Node Info, NODE2ICS, IBC_CON,
Reach Connections, Skyline and Storage Areas, with their group
attributes) and the storage-area Geometry/Storage Areas/Polygon Area, and
the engine's 1D writer writes them with the 1D tables. The pipe engine
regenerates unpinned 7.0.2 pipe-network tables and conduit terrain profiles,
and the Inlet Cells and Outlet Cells of pump stations in a 7.0.2 pipe
geometry (compute_rust_experimental() passes the engine's
--rebuild-pipes whenever the geometry has pipes). Pinned pipe products
remain in place.
User Manning's n regions (Geometry/Land Cover (Manning's n)) are computed by
the engine but not written: the engine has no writer for them, and it lists
Internal Cells in cell-index order where native lists them tile by tile
(the same set). RAS Commander keeps the stored tables and reports the
comparison in result.land_cover_regions (and, in the harness,
report.land_cover_regions against native): bitwise, same_set,
different or missing. A different or missing table means the stored
regions are stale; recompute them natively.
Geometry scope¶
The scope guard checks the components and HDF layout before creating any
output. Qualified inputs are 2D flow areas and 2D/2D connections; 1D-only
7.0.2 geometry with river reaches, cross sections, junctions, storage areas,
lateral structures and SA/SA connections; and 7.0.2 pipe networks with their
pump stations. result.qualified_components gives the engine's own list.
Inline structures, bridges, culverts, multiple openings, SA/2D connections,
SA/SA connections with a rating family (culverts), pump stations outside a
pipe geometry and mixed 1D/2D geometries require native preprocessing. Lidded
cross sections and pilot channels are refused. A 1D geometry with any
section, cell or junction the engine cannot reproduce is refused as a whole
(reason="1d-tables-refused", with the refused items in
exc.report["refused"]["items"]), for example a junction whose endpoint
order is unknown because the plain-text .g## beside the HDF is missing.
| Component id | Component | Counted in the geometry HDF |
|---|---|---|
river-reaches |
1D river reaches | rows of Geometry/River Centerlines/Attributes |
cross-sections |
1D cross sections | rows of Geometry/Cross Sections/Attributes |
junctions |
1D junctions | rows of Geometry/Junctions/Attributes |
bridges, culverts, multiple-openings |
1D bridges, culverts and multiple-opening structures | Geometry/Structures/Attributes records of Type Bridge, Culvert, Multiple Opening |
inline-structures, lateral-structures |
inline and lateral structures (lateral structures qualified in 1D-only 7.0.2 geometry) | records of Type Inline, Lateral |
storage-areas |
storage areas (qualified in 1D-only 7.0.2 geometry with cross sections) | rows of Geometry/Storage Areas/Attributes |
sa-connections |
SA/SA and SA/2D connections (SA/SA qualified in 1D-only 7.0.2 geometry, without a rating family) | Connection records with a storage area as US SA/2D or DS SA/2D |
other-structures |
structures of another type | records of any other Type |
pipe-networks, pipe-conduits, pipe-nodes |
pipe networks | rows of Geometry/Pipe Networks/Attributes, Geometry/Pipe Conduits/Attributes, Geometry/Pipe Nodes/Attributes |
pump-stations |
pump stations (qualified in a 7.0.2 geometry with pipe conduits) | rows of Geometry/Pump Stations/Attributes |
The counts are authored records. A table with no rows, or a group without its
Attributes table, counts zero, so a reserved placeholder group never makes
a model 1D. When the geometry HDF has no table for a component, the engine
counts the records of the plain-text geometry (.g##) beside it instead.
Connections with a 2D flow area on both sides (2D/2D connections, and structures inside one 2D area such as the Bald Eagle g09 dam), in weir or bridge-opening mode, are qualified. The engine's 2D tables match native output on models that contain them. Breaklines, refinement regions and boundary-condition lines are part of the 2D areas and are not counted.
compute_rust_experimental() raises RustPreprocessRefusedError. Its
components list names each refused component with its id, count and
where it was counted, and its reason is
"unqualified-geometry-components". RAS Commander does not fall back on its
own. Preprocess the geometry with native HEC-RAS instead:
from ras_commander import GeomPreprocessor, RustPreprocessRefusedError, init_ras_project
try:
result = GeomPreprocessor.compute_rust_experimental(
"copy/Muncie.g02.hdf", out_path="copy/rust/Muncie.g02.hdf")
except RustPreprocessRefusedError as exc:
print(exc.reason) # "unqualified-geometry-components"
print({c["id"]: c["count"] for c in exc.components})
# {'river-reaches': 1, 'cross-sections': 61, 'lateral-structures': 2}
ras = init_ras_project("copy", "7.0.1")
GeomPreprocessor.run_geometry_preprocessor("03", ras_object=ras) # native preprocessing
On success, result.components lists the components the engine found,
and result.refused is None. The harness returns the same fields on
report. On engine refusal, the harness also sets verdict="refused"
and fills report.refused_components. A pipe geometry with a label other
than HEC-RAS 7.0.2 October 2026 is refused even with the validation override.
For
qualification work only, allow_unqualified_components= (component ids, or
"all") lets the harness compare the 2D tables of such a geometry. The
harness compares only products the engine writes. For example, Muncie g02
(a 1D reach joined to a 2D area, mixed 1D/2D) needs
allow_unqualified_components=("river-reaches", "cross-sections",
"lateral-structures") to compare its 2D tables. The Davis pump station no
longer needs an override: pumps in a 7.0.2 pipe geometry are qualified.
compute_rust_experimental() has no such option. RAS Commander also removes
the engine's RAS_PREPROCESS_ALLOW_UNQUALIFIED_COMPONENTS environment
variable when it runs the engine, so an environment setting cannot lift the
check.
An engine build that predates the scope check (its report has no
components) is rejected with RustPreprocessError.
Get the engine¶
For 1D and pipe write-back, keep the engine's scripts/ directory from
the same checkout as the binary. Set RAS_COMMANDER_PREPROCESS_SCRIPTS
to that directory when it cannot be found above the executable, for example
when Cargo puts build outputs in a separate target directory. RAS Commander
runs the engine's writers with the active Python interpreter. The receipt
lists the written HDF paths under writeback["component_datasets"].
The engine is not distributed with RAS Commander and is not installed by
pip. It is built from the ras-commander-fast-preprocess repository, which
is not public. RAS Commander locates the executable in this order:
- the
engine_exeargument (rust_engine_pathinrun_geometry_preprocessor()andcompute_plan()); - the
RAS_COMMANDER_PREPROCESS_ENGINEenvironment variable (RAS_COMMANDER_PREPROCESS_EXE, the earlier name, is still read after it); ras-preprocessonPATH;- an engine registered by an installed package under the
ras_commander.enginesentry-point group. This is reserved for a future optionalras-commander[engines]extra; no such package exists yet.
If none resolves, the call raises RustPreprocessNotFoundError. Nothing is
downloaded. The harness records the executable path, its
ras-preprocess --version output and its SHA-256 in every report.
Qualify the engine on your model¶
validate_rust_equivalence() needs HEC-RAS 7.0.2 or 7.0.1 on Windows for
the native side. By default it uses the newest of the two that is installed;
pass hecras_version to choose. HEC-RAS runs only through RAS Commander APIs. The source project is
never written; every step works on copies inside work_dir.
from ras_commander import GeomPreprocessor
report = GeomPreprocessor.validate_rust_equivalence(
r"C:\Models\BaldEagleCrkMulti2D", # project folder or .prj; not modified
"09", # geometry number, or a .g## / .g##.hdf name
work_dir=r"C:\Work\rust-qualification\be09", # new or empty folder
engine_exe=r"C:\Tools\ras-preprocess.exe",
native_repeats=2, # repeat native runs to expose nondeterminism
)
print(report.verdict) # "equivalent", "not equivalent" or "refused"
print(report.report_markdown) # evidence to keep with the model
report.to_dataframe() # one row per compared dataset
The harness runs four steps:
- Stage. Copy the project into
work_dir/stagedwithout plan result HDFs. If the geometry HDF is missing, incomplete or from another HEC-RAS version, convert it withGeomPreprocessor.run_geometry_preprocessor()(geometry-only compute ofplan_number, or of the first plan that uses the geometry) with the native side's HEC-RAS version. Both sides then start from the same mesh. - Rust. Copy the staged project to
work_dir/rust. Overwrite every stored floating-point product with NaN (2D products, and the stored 1D cross-section products), run the engine without any correction, and write its products back through the guarded writer described below, restampingProperty Tables Last Computedascompute_rust_experimental()does. Overwriting the stored products shows that the engine computed every value it wrote: a product it read would turn its output non-finite and fail validation. - Native. Copy the staged project to
work_dir/nativeand compute the native productsnative_repeatstimes, each from a fresh copy of the staged geometry HDF whose float products are NaN: - 2D tables:
RasMap.recompute_property_tables(); - 1D tables: a geometry-only compute of
plan_number(or the first plan that uses the geometry) throughGeomPreprocessor.run_geometry_preprocessor(force=True), which setsRun HTab=-1; - pipe networks: the network's
Versionis set to1.0.18so thatRasProcess.compute_geometry()rebuilds the pipe mesh and tables; the harness requires1.0.19afterwards.
A value native preprocessing leaves unrecomputed, for example an area or
1D table it skipped while still reporting success, stops the harness with
RustPreprocessError. That NaN is never compared as native output. The
geometry preprocessor's dialog watchdog acts only on the Ras.exe it
started and that process's children, never on other HEC-RAS runs on the
host.
4. Compare. Compare every dataset of every 2D area (products and the
topology that neither side should change), and every 1D and pipe dataset
the engine wrote (rows with area "1d" or "pipes" and the full HDF
path as dataset). Info/Values tables of 2D areas are compared per
owner, so a face whose profile gains a point is reported as that face.
If the engine refuses the input, the harness stops after step 2, skips the
native runs, and returns verdict="refused" with the engine's message in
report.refusal and, for the geometry scope check, the refused components in
report.refused_components.
Read the report¶
Each dataset row reports:
| Column | Meaning |
|---|---|
status |
bitwise, within_tolerance, matches_other_native_run, expected_difference (every difference is explained by a HEC-RAS defect whose fix the engine follows; see HEC-RAS version compatibility), not_compared (a carried Stage 2 dataset the engine does not write; coverage evidence outside the verdict), different, missing_native or missing_rust |
n_different, max_abs_diff, max_ulp |
Values not bitwise equal; largest absolute difference in dataset units; largest float32 units-in-the-last-place distance |
id_kind, n_ids_different, ids_different |
Cells, faces or face points with any difference, and the first of them (max_ids, default 20) |
labels |
Known native behaviours that bear on the dataset (see Known native defects) |
The verdict is equivalent only when every dataset passes. The default
criterion is bitwise. Pass tolerance=0.01 for an absolute bar in dataset
units, for example 0.01 ft on elevations. A mapping sets a bar per dataset,
for example {"Faces Minimum Elevation": 0.01, "*": 0.0}. Integer datasets,
such as Info tables and classification indices, are always compared exactly,
and a change in a face's or cell's row count always fails.
The report also attaches:
- the engine's own per-stage
--comparecheck against native run 1 (engine_compare=True); - area attributes that differ between the two files, for information.
Both sides stamp
Property Tables Last Computedwith their own completion time, so it always differs. The Rust side keepsProperty Tables LC Hashfrom the staged input, so it differs whenever native's input-derived hash differs from the input's (see Currency attributes); - a Stage 2 infiltration and impervious coverage section whenever
Infiltration/...orPercent Impervious/...datasets are present. The engine's--comparechecks Stage 2 only throughCells Center Manning's n, so it does not compare these arrays. The dataset table compares the arrays the engine computed. A family dataset the engine does not compute (for exampleInfiltration/Properties) keeps the staged input on the Rust side. It is shown with categorycarriedand listed as not compared, because equal values there prove nothing about the engine. The engine's workstream P (in progress) adds Stage 2 infiltration and impervious coverage to--compareand the harness; until then, reports do not cover those arrays through the engine's own check; - with
include_corrected=True, the departure from native of the Composite LC corrections together (withunits="root"unlessunitsis given, the engine's former corrected mode) as a separate table that does not affect the verdict.
The JSON (rust_equivalence_report.json) and markdown
(rust_equivalence_report.md) files in work_dir are the evidence to keep.
The native and Rust geometry HDFs are kept beside them. With
keep_work=False the project copies are removed and the HDFs are kept.
Results on the RasExamples projects¶
The current engine build produced these results on 2026-11-28: ras-preprocess
0.1.0, built from source revision 9ab2592, SHA-256 025b41df…4e6f07.
The native side was HEC-RAS 7.0.1. All three cases ran in the integration
tests, tests/test_rust_preprocess_integration.py.
| Model | Native runs | Datasets compared | Verdict | Wall time |
|---|---|---|---|---|
| BaldEagleCrkMulti2D g09 (19,597 cells, 37,594 faces; SCS infiltration and percent impervious) | 2 | 36 compared, all bitwise (20 products and 16 inputs; 8 of the 9 Stage 2 family datasets compared as engine output), plus Infiltration/Properties listed as carried and not compared |
equivalent | 224 s |
| Muncie g02 with a SetValue polygon terrain modification crossing 195 faces and 96 cells | 1 | 28 (12 products), all bitwise | equivalent | 36 s |
| Muncie g02 with a rotated ellipse terrain modification (30°, 200 × 80 ft) | — | none | refused: Basin (Type="Circle" …): rotated ellipse (30 degrees, radii 200 x 80); its native Stage 1 face intersection is not reproduced |
15 s |
The previous build (26ca082) gave the same verdicts. On it, the corrected
mode was also bitwise on Bald Eagle g09, where Composite LC and Multiple Face
Mann n are off, and a second native run on the Muncie case agreed with the
first. The host was shared with other HEC-RAS jobs during the 9ab2592 runs.
Each wall time includes staging and the native 7.0.1 conversion of the geometry, which was authored in an earlier HEC-RAS version.
1D cross sections and pipe networks, HEC-RAS 7.0.2 (2026-12-01)¶
Engine: ras-preprocess 0.1.0 from the integration branch
feat/integration-1d-pipes (D1 fcce72a, P1 ee8d132), with
RAS_COMMANDER_PREPROCESS_SCRIPTS pointing at the same checkout's
scripts/. Native side: HEC-RAS 7.0.2 through RAS Commander, one job at a
time, on a local disk. Each wall time includes the native 7.0.2 conversion of
the staged copy.
| Model | Components | Datasets compared | Verdict | Wall time |
|---|---|---|---|---|
JunctionHydraulics g03 (RasExamples; structure-free geometry, plan 04) |
3 reaches, 12 cross sections, 1 junction | 27 1D datasets, 36,821 values, all bitwise | equivalent | 85 s |
Davis g02 (RasExamples, converted from 6.7 Beta 5 to 7.0.2; allow_unqualified_components=["pump-stations"]) |
2 2D areas; 1 pipe network, 132 conduits, 133 nodes; 1 pump station (not compared) | 87: 56 2D datasets and 31 pipe datasets (29 network, 2 conduit terrain profile; 133,736 values), all bitwise | equivalent | 53 s |
West Fork Calcasieu, structure-free 7.0.2 variant (the engine's WF_xs_702_a, made runnable as below) |
24 reaches, 1,808 cross sections, 10 junctions | 27 1D datasets, 182,018,577 values, all bitwise | equivalent | 19 min (native 1D compute 679 s) |
D1 Bald Eagle fixture (compute_rust_experimental() only, no HEC-RAS) |
178 cross sections | 25 written 1D datasets equal the native tables in the source | — | 4 s |
The West Fork project's boundary DSS files are not retained. HEC-RAS checks
every flow file of the project even for a geometry-only compute, and stops on
the missing DSS files with an "errors were found preparing unsteady flow
data" window that the dialog watchdog does not dismiss; the run then ends at
the harness timeout. The engine's scripts/xs_tables/runnable_copy.py
made a local copy runnable for plans 01 and 02 (constant inline hydrographs
and a one-day window, through RAS Commander) before the harness ran. A large
1D model needs a timeout above the native compute time, which is also the
native geometry compute's max_wait.
With that earlier engine, compute_rust_experimental() on the staged,
converted Davis geometry was refused for its pump station; the integrated
engine below writes it. On Junction Hydraulics it writes the same 27 datasets
the harness compared.
Storage areas, lateral structures and pump stations, HEC-RAS 7.0.2 (2026-12-01)¶
Engine: ras-preprocess 0.1.0 from feat/integration-1d-pipes at bd8572d
(D1 b73abef, S2 8d8733f, P1 6e279d1, R2 c14559b, S1 6f70ae5),
SHA-256 829b3878…749c5087, with RAS_COMMANDER_PREPROCESS_SCRIPTS pointing
at the same checkout's scripts/. Native side: HEC-RAS 7.0.2 through RAS
Commander, one job at a time, on a local disk, with the RasExamples copy
pruned to the target plan (RasPlan.delete_plan) first. The harness removed
the stored connectivity and seeded the pump cells with an invalid cell on
both sides; native rebuilt every one of them. hecras_processors was this
host's 8.
| Model | Components | Datasets compared | Verdict | Wall time |
|---|---|---|---|---|
| Lateral Structure Overflow Weir (LatMultXS g01, plan 01; converted to 7.0.2) | 1 reach, cross sections, 1 storage area, 1 lateral weir | 72: 25 1D datasets and 47 connectivity rows (41 datasets including Polygon Area, and the attributes of 6 groups); 332,926 values, all bitwise |
equivalent | 17 s |
| Davis g02 (plan pruned to the one using g02; converted from 6.7 Beta 5 to 7.0.2), no override | 2 2D areas; 1 pipe network, 132 conduits, 133 nodes; 1 pump station | 88: 56 2D, 31 pipe and 1 pump dataset (Outlet Cells; the inlet is a pipe node, so it has no Inlet Cells), all bitwise |
equivalent | 27 s |
compute_rust_experimental() wrote both staged geometries: LatMultXS with its
connectivity in result.writeback["component_datasets"]["connectivity"]
and Davis with its pump cells under ["pumps"].
Muncie g02 is a mixed 1D/2D model: a 1D reach of 61 cross sections joined to
the 2D area by 2 lateral structures. Since the engine's geometry scope check
(2026-11-29), the harness refuses it unless
allow_unqualified_components=("river-reaches", "cross-sections",
"lateral-structures") is given, as the integration tests do to compare its
2D tables.
Use the products¶
Run compute_rust_experimental() only on a model whose qualification report
is equivalent for the same engine build and options.
result = GeomPreprocessor.compute_rust_experimental(
r"C:\Work\model\Model.g09.hdf", # complete HEC-RAS 7.0.1 or 7.0.2 geometry HDF
out_path=r"C:\Work\model-rust\Model.g09.hdf",
engine_exe=r"C:\Tools\ras-preprocess.exe",
)
result.engine.sha256, result.options, result.writeback["datasets_changed"]
- The engine opens the source read-only and resolves the terrain and layers
relative to it. The products go into a copy at
out_path.in_place=Truewrites the source itself, keeping a<name>.<random>.pre-rust.bakbackup beside it (the receipt'sbackup). Each call has its own backup, so an earlier retained backup is never overwritten. - Native HEC-RAS is the default. Without a correction argument the engine
reproduces native HEC-RAS 7.0.1 and 7.0.2, including the unfixed defects
D-4 and W-1. The D-5 default applies the base overrides as local HEC-RAS does. This is the output the harness qualifies, so a qualified
model gets the tables the harness proved. Each defect has its own opt-in
correction (see Opt-in engine corrections).
RAS Commander passes each correction as its own engine flag and never
passes the engine's hidden
--modealias. native_compatibleis deprecated. It still works and emits aDeprecationWarningwhen given.native_compatible=Falsemeanscorrect_composite_mask=Trueandunits="root"(unlessunitsis given), exactly the engine's former--mode corrected.native_compatible=Trueadds nothing. The argument was deprecated rather than kept because one switch for two independent defects cannot express the engine's per-defect corrections, and because native output is now the default of both the engine and RAS Commander.restamp_currency=True(the default) sets each written area'sProperty Tables Last Computedthe way native recomputation does. See Currency attributes. The choice is recorded inresult.options["restamp_currency"], andresult.currencyholds the stamp and each area's before and after value.- The writer warns about any
File Versionother thanHEC-RAS 7.0.1 June 2026orHEC-RAS 7.0.2 October 2026(it refuses one withrequire_supported_version=True), and refuses any geometry that is notComplete Geometry=True. It writes only datasets that already exist and never creates a dataset or an attribute. The only attribute it writes is the currency stamp above. Before writing, it validates the products: finite, positive cell Manning's n; contiguousInfotables; strictly increasing elevations; volume curves that start at 0; ghost-cell conventions; and every cell minimum at or below each adjacent face minimum; and every packedInfotable written with itsValuesaccounts for each row exactly once. Every write is read back exactly. The 2D writer hashes every dataset and snapshots every attribute before and after the write; a change outside the written datasets, or to any attribute other than the currency stamps and theras-commander Correctionsmarker (set for corrected output, removed otherwise), rolls the write back. The receipt reports the counts, the changed dataset and attribute names and the file's SHA-256 before and after, not every hash. On any failure the file is restored from this call's backup; if the restore itself fails, the backup is kept and named in the error for manual recovery. - The result records the engine path, version and SHA-256, the options, the exact command, the engine's report and notices, the write-back receipt and the source SHA-256.
Select the engine for preprocessing and plan runs¶
GeomPreprocessor.run_geometry_preprocessor() takes engine= and
RasCmdr.compute_plan() takes preprocess_engine=, each with
rust_engine_path= for the executable:
| Value | Behaviour |
|---|---|
"native" (default) |
HEC-RAS preprocesses the geometry. Nothing changes from earlier releases. |
"rust" |
The engine writes the tables into the project's geometry HDF in place. Anything outside its qualified scope stops the call with the reason and the refused components. |
"auto" |
Try the engine; when it refuses the geometry, is not installed or fails without changing the geometry HDF, use native HEC-RAS preprocessing instead. |
from ras_commander import RasCmdr, init_ras_project
ras = init_ras_project(r"D:\Work\Model", "7.0.2")
result = RasCmdr.compute_plan(
"01", ras_object=ras, dest_folder="rust_run",
preprocess_engine="rust", # or "auto"
rust_engine_path=r"D:\Tools\ras-preprocess.exe",
)
record = result.execution_details["preprocess_engine"]
record["engine_used"], record["fallback_reason"], record["refused_components"]
The hook is qualified for HEC-RAS 7.0.2 only. Before the engine runs, the
"rust" and "auto" modes check that:
- the project runs HEC-RAS 7.0.2 (
unsupported-hecras-version); - the geometry HDF exists (
geometry-hdf-missing). The engine writes tables into an existing geometry HDF; it does not import the geometry text, so run native preprocessing once on a new or converted model; - the geometry HDF is newer than the
.g##text of the same geometry (geometry-hdf-stale;geometry-text-missingwithout the text), so a text edit is imported natively first; - its
File VersionisHEC-RAS 7.0.2 October 2026(unsupported-file-version) and it is a complete geometry (incomplete-geometry).
Then the engine's own scope check applies: 2D flow areas and 2D/2D connections; 1D cross sections, reaches and junctions; storage areas, lateral structures and SA/SA connections without rating families; pipe networks and their pump stations. Bridges, culverts, inline structures, SA/2D connections and the other components in Supported and refused inputs are refused before anything is written.
In run_geometry_preprocessor(), the Rust route first waits, like the native
route, for a previous native run of the plan to exit, refuses a geometry
HDF the caller still holds open, and refuses while any plan that uses the
same geometry may be running. One max_wait budget covers that wait, the
Rust attempt and any native fallback. require_complete_products=True is a
native completion check: "rust" rejects it with ValueError and "auto"
preprocesses natively.
With "rust", run_geometry_preprocessor() raises
RustPreprocessRefusedError (exc.reason, exc.components),
RustPreprocessNotFoundError or RustPreprocessError. compute_plan()
returns success=False before launching HEC-RAS, with
failure_stage="rust_preprocess" and the refused components in
failure_detail and execution_details["preprocess_engine"].
The two engines' outputs are never mixed in one geometry. The engine refuses
before writing, and its writer restores the geometry HDF from a backup on any
failure. "auto" falls back only when the geometry HDF is byte-identical to
its state before the attempt; otherwise the call fails.
What compute_plan() does with the Rust tables¶
- The smart skip and
skip_existingare evaluated first; a skipped run does not preprocess. Before the geometry HDF is read or written, every plan thatplan_dflists with the same geometry (this plan included) must be shown idle by the exact-plan process inventory. A running plan, an incomplete inventory or a missing plan list stops the run (GeometryInUseError).force_geompre=Truerequests native processing and cannot be combined with"rust"or"auto"(ValueError). - The engine writes the tables into the geometry HDF of the project that
runs (the
dest_foldercopy when one is given). The file's modification time is kept, so it stays current with its geometry text. - For the launch, the plan gets
Run HTab= 0andUNET Use Existing IB Tables=-1, so HEC-RAS runs on the stored tables instead of running its geometry preprocessor. The original plan bytes and modification time are restored after the run. - After the run, every dataset the engine wrote, and the attributes of the
groups that hold them, are hashed again, and the run's compute messages are
read. If HEC-RAS changed any of them, if the messages cannot be read, or
if they show the geometric preprocessor (
Geometric Preprocessor/Finished Processing Geometry), the run fails withfailure_stage="rust_preprocess_tables_recomputed". Tables equal to native would hide a native recompute from the hashes alone; the compute messages are the direct evidence (hecras_geometry_preprocessor_ran). HEC-RAS may still change the bytes of the geometry HDF file without changing any dataset or attribute.
execution_details["preprocess_engine"] (and
GeometryPreprocessResult.preprocess_engine) holds requested,
engine_used, fallback_reason, refusal_reason, refusal_message,
refused_components, components, the engine path, version and SHA-256
(rust_engine), the command, notices, the written datasets,
tables_unchanged_by_run, changed_by_run and
hecras_geometry_preprocessor_ran. The engine choice and any fallback are logged
at INFO; a refusal under "rust" is logged at ERROR.
Known limitations of the engine selector¶
- The shared-geometry check is not a lock. Before the write, every plan whose plan file names the geometry must be idle. A native HEC-RAS run of another plan on the same geometry that starts after the check, while the engine writes, is not blocked. Do not start other plans on the same geometry while Rust preprocessing runs.
- A rejected run still leaves a complete native result. When a run fails
with
failure_stage="rust_preprocess_tables_recomputed", HEC-RAS recomputed the tables itself and its plan HDF is a complete native result. A latercompute_plan(..., skip_existing=True)accepts that result. Useforce_rerun=Truewhen the run must use the Rust tables.
Plan run on the Rust tables, HEC-RAS 7.0.2 (2026-12-02)¶
tests/test_preprocess_engine_hook_integration.py (opt-in with
RAS_COMMANDER_RUN_HECRAS_INTEGRATION=1) ran on RasExamples Lateral
Structure Overflow Weir (LatMultXS g01: 57 cross sections, a storage area and
a lateral weir), with the project pruned to plan 01. The engine was built from
feat/integration-1d-pipes (5cb04d5).
| Step | Result |
|---|---|
Native conversion of g01 to HEC-RAS 7.0.2 (run_geometry_preprocessor) |
succeeded |
Native control run (compute_plan, plan flag Run HTab= 1) |
compute messages include "Geometric Preprocessor" and "Finished Processing Geometry" |
compute_plan(preprocess_engine="rust") on a copy of the same staged project |
66 datasets written; all 66 unchanged after the run; no geometric preprocessor in the compute messages; "Finished Unsteady Flow Simulation" |
| Plan flags after the Rust run | Run HTab= 1 and UNET Use Existing IB Tables=-1 restored; the rest of the plan unchanged apart from Write Detailed= 1, which compute_plan() always sets |
| Cross-section water surface, native run vs Rust run | bitwise equal |
The geometry HDF file's bytes changed during the Rust run even though no dataset or attribute did, so a file hash is not evidence that HEC-RAS recomputed anything. The compute messages are.
Currency attributes¶
When native HEC-RAS 7.0.1 recomputes property tables
(RasMap.recompute_property_tables), it changes exactly two attributes. The
evidence is an attribute-only diff of every object in the geometry HDF before
and after two consecutive native runs, on Muncie g02 and Bald Eagle g09. No
root, Geometry or layer attribute changes, and no dataset outside the
products changes.
| Attribute | Where | What native writes | Rust write-back (restamp_currency=True) |
|---|---|---|---|
Property Tables Last Computed |
each recomputed 2D area | The local wall-clock time at which the area's tables completed, DDMONYYYY HH:MM:SS with an upper-case English month (for example 27NOV2026 22:59:52), stored as an 18-byte fixed-length string |
Restamped. Set to the local time of the write-back, in the same format. It is written through the existing attribute, so its stored type is unchanged, and read back exactly. An area without the attribute is left without it. |
Property Tables LC Hash |
areas with a land-cover association | A 32-byte SHA-256 derived from the land-cover inputs. Native rewrites it only when its value differs from the stored one. | Kept from the source, with a warning. |
Native builds the LC hash over RasMapperLib's hash of the calibration-region
feature layer, each region's class-to-n map, the land-cover names and the base
n values. That construction is not specified exactly enough to reproduce, and
the engine does not compute it, so RAS Commander does not guess it. When an
area carries the hash, compute_rust_experimental() keeps the source value,
records it in result.currency["not_restamped"] and emits
ExperimentalWarning. The stored hash is a currency signal: native reports
"Mesh property tables are current" only while it matches the inputs. A Rust
result is therefore current exactly when its source geometry HDF was current.
After a land-cover or calibration-region edit, run native preprocessing first.
restamp_currency=False writes no attribute at all, as earlier builds of this
feature did.
Evidence that HEC-RAS accepts the Rust tables¶
These checks ran on HEC-RAS 7.0.1 on 2026-11-27, through RAS Commander APIs
only, with engine build 9ab2592:
| Check | Muncie g02 (plan 03) | Bald Eagle g09 (plan 03) |
|---|---|---|
RasCurrency.is_geom_preprocessing_current() after the write-back |
current | current |
| Native RAS Mapper on a copy of the Rust result | "Mesh property tables are current." | "Mesh property tables are current." |
RasCmdr.compute_plan() on the Rust result |
"Mesh property tables are current."; completed | "BaldEagleCr: Mesh property tables are current."; completed |
| Geometry HDF datasets and attributes after the plan compute | unchanged (restamp kept) | attributes unchanged (restamp and LC hash kept); 2D area datasets unchanged |
| Plan HDF property tables | byte-identical to the Rust tables | byte-identical to the Rust tables |
On Bald Eagle, the LC hash discriminates. The same Rust write-back applied
to the geometry HDF straight from the native 7.0.1 conversion keeps that
file's hash, and RAS Mapper then reports "Manning's n calibration regions have
changed". Native behaves the same way on its own output: the first native plan
compute writes a hash that the next native plan compute finds stale ("Refreshed
association-derived tables without rebuilding cell volume tables"). The
Rust result inherits whatever currency its source had. Every plan compute,
native or Rust, also rewrites Geometry/Land Cover (Manning's n)/Internal
Cells. That dataset lies outside the 2D area products and the Rust write-back
does not touch it.
Each case starts from the state native itself accepts. The geometry was
converted to 7.0.1 with GeomPreprocessor.run_geometry_preprocessor(), as
the harness stages it, and the plan was then computed natively twice. On
Muncie, the second native compute reported the tables current. On Bald
Eagle, it refreshed the association-derived tables and the LC hash, and the
Rust write-back started from that refreshed file. The
first native plan compute after a conversion rebuilds the tables itself
("Property tables do not exist"), whatever they contain. On Muncie, a project
plan-computed twice without the explicit conversion was still rebuilt on the
second run. Check the compute messages of your own workflow. On Muncie, every check also passed with
restamp_currency=False: HEC-RAS 7.0.1 does not compare
Property Tables Last Computed, and it does not compare the file
modification time either. The restamp keeps the stamp
truthful rather than changing the verdict. On these models the Rust tables
are bitwise equal to native, so the checks show that the write-back leaves the
file in a state HEC-RAS accepts. They do not show what HEC-RAS does with
tables that differ from native.
HEC-RAS version compatibility¶
The engine reproduces HEC-RAS 7.0.1 and 7.0.2 preprocessing (engine commit
f0a8b24 and later). Native 7.0.2 writes the same 2D geometry tables as 7.0.1,
except where 7.0.2 fixed a 7.0.1 defect. There the engine follows 7.0.2; it
has no 7.0.1 mode. Today the only such defect is V-1, described
below.
File Version labels¶
Both entry points read the geometry HDF's root File Version attribute.
| Label | Behavior |
|---|---|
HEC-RAS 7.0.1 June 2026, HEC-RAS 7.0.2 October 2026 |
Accepted without a warning. |
| Any other label, or none | Processed with a warning. RAS Commander logs a WARNING and emits an ExperimentalWarning that names the file and its label and says the results may differ from that version's native preprocessing. |
Any other label, or none, with require_supported_version=True |
Refused with RustPreprocessError before the engine runs. The engine also receives --require-supported-version. |
result = GeomPreprocessor.compute_rust_experimental(
r"C:\Work\copy\Model.g01.hdf",
out_path=r"C:\Work\copy\rust\Model.g01.hdf",
)
print(result.file_version) # the source's File Version label
print(result.version_warning) # None for 7.0.1 or 7.0.2; otherwise the warning text
print(result.notices) # engine notices, for example V-1 (see below)
The warning text is stored in version_warning and the label in
file_version, on RustPreprocessResult, RustEquivalenceReport and their
to_dict() output. The harness also adds the warning to the report notes and
shows it in both written reports.
allow_file_version_mismatch is the deprecated spelling of the strict
switch. It still works and emits a DeprecationWarning:
allow_file_version_mismatch=False behaves as
require_supported_version=True, and allow_file_version_mismatch=True is
now the default behavior.
The label records the HEC-RAS version that created, or last fully rewrote, the geometry HDF. A RAS Mapper property-table recompute does not update it, so the label is not proof of which preprocessor last ran.
Native version in the harness¶
validate_rust_equivalence(hecras_version=None) uses the newest checked
HEC-RAS installed: 7.0.2 when present, otherwise 7.0.1. The choice is
recorded in the report notes. An explicit hecras_version still selects the
native side; a version other than 7.0.1 or 7.0.2 runs with a WARNING that it is
unchecked.
A staged geometry HDF labeled 7.0.1 or 7.0.2 is used as is, whichever native
version runs. Any other label is first converted with native hecras_version
through GeomPreprocessor.run_geometry_preprocessor(). HEC-RAS 7.0.2 ignores
the -c plan argument of Ras.exe and computes every plan in the project;
run_geometry_preprocessor() exposes only the selected plan to that launch
(its single-plan guard) and restores the project file afterwards. The native
reference depends on the component: 2D tables come from
RasMap.recompute_property_tables(), 1D tables and the solver connectivity
from a geometry-only plan compute, and pipe networks and pump cells from
RasProcess.compute_geometry(). An explicit plan_number must use the
requested geometry; otherwise the harness refuses before any native run.
Engine notices¶
The engine reports facts about how it treated a geometry as notices. Each
notice is a mapping with id, message, url and layers. A notice about
2D flow areas also has areas. RAS Commander passes them through as
result.notices and report.notices, includes them in to_dict() and the
markdown report, and logs each distinct notice once at WARNING.
| Notice id | When | Extra fields |
|---|---|---|
hecras-7.0.1-groundline-system-name |
The HEC-RAS 7.0.2 fix of defect V-1 changed the result (see below). | layers |
hecras-composite-mask-worker-dependent |
An area uses Composite LC and D-4 is not corrected. HEC-RAS's own composite values depend on the cell order and the RAS Mapper worker count; the results reproduce HEC-RAS run with hecras_workers worker threads. |
areas, hecras_workers |
Defect V-1: line modifications grouped by System Name¶
HEC-RAS 7.0.1 applies a ground-line terrain-modification layer (levees and
channels) to the Stage 1 face profiles only up to and including the first
System Name system with two or more members, in feature-ID order. Later
features that are not members of that system leave the face profiles on the
unmodified terrain, although 7.0.1 still draws them into the cell tables.
HEC-RAS 7.0.2 fixed this. Its release notes list the fix under Resolved
Issues as "Line Terrain Modifications Not Applying Profile In Multiple
Systems" (HEC-RAS 7.0.2 Resolved Issues).
When the fix changes a geometry's result, the engine reports the notice
hecras-7.0.1-groundline-system-name and names the affected layers. The
results then match native 7.0.2 and can differ from native 7.0.1 on those
layers. A geometry without a multi-member system is not affected.
Against a native 7.0.1 oracle, the harness reports the differences V-1 can
produce as expected differences. They are listed under
report.expected_differences and in their own report section, with the
reason "HEC-RAS 7.0.1 defect V-1, fixed in 7.0.2" and the link above. The
classification explains a difference only when all of these hold:
- The native side is HEC-RAS 7.0.1 and the engine's V-1 notice fired.
- The dataset is one that V-1 can change:
Faces Profile Info/Values,Faces Area Elevation Info/Values,Faces Minimum Elevation,Faces Low Elevation Centroid,FacePoints Elevation,Cells Volume Elevation Info/ValuesandCells Minimum Elevation. Manning's n, cell surface areas and the classification families are never explained. - The face's profile differs, and its face line comes within 1.5 times
Max Reachof a ground-line feature, or system, that 7.0.1 skipped. RAS Commander finds the skipped features from the terrain HDF with the engine's rule. If that rule finds no skipped feature in a layer the notice names, nothing is explained. - Other face datasets may differ only on those faces. Face points may differ
only at their ends, and cells only next to them. An
Infotable is explained only through its count column, and only when both sides are packed contiguously.
A dataset whose differences are all explained has status
expected_difference and passes. Any other difference, including one outside
the gate in an otherwise explained dataset, stays a mismatch and fails the
run. Against native 7.0.2 nothing is expected to differ, and V-1 explains
nothing.
Results on 2026-11-29¶
These runs used ras-preprocess 0.1.0 built from engine commits f0a8b24
(SHA-256 90b2db26…a4bef82d) and 45a5804 (SHA-256 90d96e1e…0ddbe1cb),
with identical results on both, on Muncie g02 from RasExamples. The
Composite LC row used a clean build of engine 511fcb9 (SHA-256
6f2c936b…e467845c), on which every other row's integration test also
passed:
| Case | Native side | Datasets | Verdict |
|---|---|---|---|
| Muncie g02 | 7.0.1 | 28, all bitwise | equivalent |
| Muncie g02 (7.0.1-converted copy) | 7.0.2 (default selection) | 28, all bitwise | equivalent |
Muncie g02 with a levee layer: a two-member System Name system, then a lone levee |
7.0.1 | 19 bitwise, 9 expected_difference (155 faces, 51 face points, 32 cells; 0 unexplained); V-1 notice for V1Levees |
equivalent |
| The same geometry | 7.0.2 | 28, all bitwise; V-1 notice for V1Levees |
equivalent |
Muncie g02 with a rotated ellipse (30°, 200 × 80 ft), correct_rotated_ellipse_crossings=True (engine 45a5804) |
7.0.1 | 28, all bitwise (uncorrected output); the correction, run separately, changed 32 face profiles (largest 42.08 ft), 16 face minima, 18 face points and 8 cells (largest 12.38 ft) | equivalent |
BaldEagleCrkMulti2D g09 with Composite LC turned on, correct_composite_mask=True and correct_face_mann_overrides=True (engine 511fcb9) |
7.0.1 | all bitwise (uncorrected output, D-4 copied for 1 worker); D-4 notice for BaldEagleCr. The corrections, run separately, recorded only hecras-composite-mask-stale (Multiple Face Mann n is off, so D-5 cannot act) and changed 7 datasets, including 2,184 cells' Manning's n (largest 0.0170) |
equivalent |
Opt-in engine corrections¶
Native defects that HEC-RAS has not fixed are copied by default, so the engine's default output stays native-equivalent. Each has its own opt-in correction. D-5 follows the local-disk native behavior by default.
| Defect | Native behavior (HEC-RAS 7.0.1 and 7.0.2) | Opt-in correction | Correction record |
|---|---|---|---|
| W-1 | For a rotated non-circular ellipse modification, the face crossing is found in the ellipse's rotated frame and applied to the unrotated face, so interval ends move along the face and faces the ellipse does not reach can get an interval. | correct_rotated_ellipse_crossings=True (engine flag --correct-rotated-ellipse-crossings): Stage 1 uses the true crossings. Circles and unrotated ellipses are unchanged. |
hecras-rotated-ellipse-face-crossings, with layers |
| D-4 | Composite LC: the per-worker cell mask is never cleared, so a cell's composite Manning's n and land-cover parameters include pixels set by earlier cells in its 4,000-cell chunk. The result depends on the cell order and the RAS Mapper worker count. | correct_composite_mask=True (engine flag --correct-composite-mask): every cell starts from an empty mask. |
hecras-composite-mask-stale, with areas |
| D-5 | Multiple Face Mann n applies LCMann Table overrides by default. On network shares native can drop those overrides. |
hecras_network_share_mfn_drop=True passes --hecras-network-share-mfn-drop to approximate the drop when the calibration row and class counts differ. |
hecras-network-share-face-mann-drop, with areas |
| D-2 | Green-Ampt Residual Soil Water Content and Pore Size Distribution Index are treated as mandatory: a layer without them makes native fail and write no tables (the engine fails the same way by default). |
correct_green_ampt_optional=True (engine flag --correct-green-ampt-optional): missing values are written as -9999, as SCS does for its optional variable. There is no native output to compare the corrected tables with. |
hecras-green-ampt-optional-mandatory, with areas |
| P1-7 | Pipe nodes on modified terrain: the node volume tables use the terrain with its modifications, the mesh's surface-connection test the terrain without them (HEC-RAS 7.0.2). | correct_node_terrain_mods=True (engine flag --correct-node-terrain-mods): the modified terrain for both. |
hecras-pipe-node-terrain-mods, with networks |
compute_rust_experimental() passes the flag of each correction you request.
When a correction changes the result, the engine lists it in its
corrections field with the layers (W-1) or 2D areas (D-4, D-5) it changed.
RAS Commander passes that list through as result.corrections, logs a
WARNING that the tables depart from native, and writes the root attribute
ras-commander Corrections (the ;-separated ids) into the output geometry
HDF. A file without that attribute holds native-equivalent tables; a later
write without a correction removes a stale attribute. Both changes are
listed in the write-back receipt. A requested correction that changes
nothing (for example D-5 on a geometry with Multiple Face Mann n off) is not
listed.
D-4, the RAS Mapper worker count and the processor count. Without the
D-4 correction, the engine reproduces native for a stated RAS Mapper
worker-thread limit, hecras_workers (engine flag --hecras-workers,
default 1, the limit RasMap.recompute_property_tables() uses), on a host
with hecras_processors logical processors (engine flag
--hecras-processors). RAS Commander's default for hecras_processors is
this host's count (os.cpu_count()), which is what native HEC-RAS sees when
RAS Commander runs it here; both entry points record the value in
options. The engine follows the .NET Parallel.For schedule RAS Mapper
uses, at any worker count (engine workstream R2; bitwise with every native
run measured at 1 to 16 workers on an 8-processor host). On a geometry
without Composite LC the values have no effect. Each Composite LC area gets
the notice hecras-composite-mask-worker-dependent. An engine build older
than --hecras-processors is rejected with RustPreprocessError.
validate_rust_equivalence() always compares the uncorrected engine output
with native, which RAS Commander recomputes with one worker on this host.
With any of correct_rotated_ellipse_crossings, correct_composite_mask,
correct_green_ampt_optional, correct_node_terrain_mods or
hecras_network_share_mfn_drop it also runs the engine once with every
requested correction and reports, without effect on the verdict, what they
changed relative to the uncorrected output: report.correction_effect (per
dataset, the differing faces or cells and the largest absolute difference),
report.corrections (the engine's records), report.corrections_requested,
and an "Opt-in correction effect" section in the markdown report.
The legacy correct_face_mann_overrides keyword is still accepted. The
combined engine already applies the overrides by default.
For any version, the side-by-side harness remains the preferred proof of equivalence before any production use.
Supported and refused inputs¶
The engine reproduces HEC-RAS 7.0.1 and 7.0.2. It refuses inputs whose native
rules it does not reproduce and names what it refused. RAS Commander raises
RustPreprocessRefusedError and never falls back to another method. The
harness reports such a case as refused.
| Input | Status |
|---|---|
| Geometry scope | 2D flow areas and 2D/2D connections; 7.0.2 1D-only geometry with river reaches, cross sections, junctions, storage areas, lateral structures and SA/SA connections; 7.0.2 pipe networks with their pump stations. |
| Geometry HDF | Complete HEC-RAS 7.0.1 or 7.0.2 geometry HDF with 2D flow areas, or a complete 7.0.2 geometry HDF with 1D-only geometry or pipe networks. Earlier versions need native conversion; the harness converts the staged copy. Other labels run with a warning (see HEC-RAS version compatibility). |
| Terrain | Registered HEC-RAS terrain HDF with tiled, north-up GeoTIFF sources with square tiles, including stitch TINs. Other layouts are refused. |
| Layer associations | Land cover, infiltration, percent impervious and sediment bed material, resolved from the geometry HDF's association attributes. Native HEC-RAS can also resolve a stale association through the .rasmap; the engine refuses it and names the missing file. Repair the association first. |
| Manning's n | Point sampling, LCMann Table overrides, calibration regions, Composite LC and Multiple Face Mann n (with D-4 and D-5; see below). |
Terrain modifications (the terrain HDF's /Modifications) |
Supported, including modifications that cross faces: constant-value polygons, polygons with control points, circles and ellipses (SetValue, SetIfHigher, SetIfLower; rotated ellipses with engine 45a5804 or later, reproducing defect W-1), and channel and levee ground lines with profiles, including System Name systems (V-1). |
| Refused modifications | Rotated non-circular ellipses with engines older than 45a5804; Encroachment Polygon, Levee1, Pier, Tree, Rectangle and Triangle types; polygons whose elevations come from their vertex Z values; named ground-line systems that have layer control points. A terrain with one refused layer is refused as a whole. |
The engine's qualification beyond these example projects is recorded in its own repository. It covered the RasExamples 2D geometries, eBFE models and larger 2D models, and found bitwise agreement or departures that the defect register below explains.
Known native defects¶
Native HEC-RAS preprocessing has defects. A defect HEC-RAS has not fixed is copied by default, with its own opt-in correction. A defect whose native output is not reproducible (a race) cannot be copied; the engine gives the deterministic, uncorrupted result. A defect HEC-RAS fixed is always followed, with a notice. RAS Commander uses the engine's defaults. The harness labels these cases in its report rather than hiding them.
| ID | Where | Native behavior | Engine default | RAS Commander default |
|---|---|---|---|---|
| D-4 | Composite LC (cell-average Manning's n and classification parameters) | The per-worker cell mask is never cleared, so a cell's average includes pixels set by earlier cells. About one cell in nine changes on the Bald Eagle Composite LC fixture. Native output depends on the worker limit and the host's processor count. Unfixed in HEC-RAS 7.0.1 and 7.0.2. | Reproduced for --hecras-workers and --hecras-processors (the .NET Parallel.For schedule), with a notice; --correct-composite-mask corrects it |
Reproduced for one worker on this host's processor count; opt in with correct_composite_mask=True |
| D-5 | Multiple Face Mann n | Network-share runs can drop base LCMann Table overrides. |
Local-disk behavior applies overrides. | Set hecras_network_share_mfn_drop=True to approximate the share result. |
| D-2 | Green-Ampt optional variables | Treated as mandatory; native fails without them. Unfixed in 7.0.1 and 7.0.2. | Fails as native does; --correct-green-ampt-optional writes -9999 |
Same; opt in with correct_green_ampt_optional=True |
| P1-7 | Pipe nodes on modified terrain | Two terrain samples per node (with and without modifications). HEC-RAS 7.0.2. | Reproduced; --correct-node-terrain-mods corrects it |
Reproduced; opt in with correct_node_terrain_mods=True |
| L-1 | Faces with more than 1,000 profile points | Native integrates them with an unsynchronized parallel loop, so its output is not reproducible. | Deterministic serial integration | Same; the harness lists such faces |
| N-1 | Polygon modifications with control points | A race on a shared quadtree: some native runs give different values on faces and cells crossing the polygon, or stop in Stage 1. | The uncorrupted result | Same; repeat native runs to expose it |
| N-2 | Stage 1 tile-piece order | Under the default .NET thread pool, the order of tied profile points follows thread scheduling. | Ascending tile order, which equals native under RAS Commander's one-worker pool | Same |
| N-3 | Stitch-TIN edge order | Depends on a process-assigned runtime type id. Observed stable. | The observed value | Same |
| W-1 | Rotated non-circular ellipse modifications | The face crossing is taken in the ellipse's rotated frame. Unfixed in HEC-RAS 7.0.1 and 7.0.2. | Reproduced; --correct-rotated-ellipse-crossings corrects it |
Reproduced; opt in with correct_rotated_ellipse_crossings=True (see Opt-in engine corrections) |
| V-1 | Ground-line systems (System Name) |
HEC-RAS 7.0.1 leaves features after the first multi-member system out of the face profiles. Fixed in HEC-RAS 7.0.2. | The 7.0.2 rule, with a notice | Same; no 7.0.1 mode. The harness reports the differences as expected against native 7.0.1 |
Defects D-1 and D-3 concern the property-table currency hash and overlapping calibration regions. The engine keeps native behavior for them. For D-1, the engine's register says the LC hash is never reported current. On Bald Eagle g09, a repeat native recompute did report it current (see Currency attributes). The hash a native plan compute writes on a freshly converted geometry is the one that reads as stale.
With native_repeats > 1, the harness compares native runs with each other.
It labels datasets on which they disagree (N-1, N-2) and passes a Rust dataset
that equals any one of them (matches_other_native_run). A single native run
cannot expose native nondeterminism.
Limitations¶
- Two HEC-RAS versions and one native producer per family. The 2D
reference is HEC-RAS 7.0.1 or 7.0.2 RAS Mapper recomputation
(
RasMap.recompute_property_tables); the 1D reference is the 7.0.2 geometry preprocessor of a geometry-only plan compute; the pipe reference is a forced 7.0.2RasProcess.compute_geometryrebuild. The harness does not run the unsteady solver. - Stage 2 infiltration and impervious coverage. The engine's
--comparecovers Stage 2 only throughCells Center Manning's n. The engine's workstream P (in progress) adds infiltration and impervious coverage to--compareand the harness, so current reports do not cover those arrays through the engine's own check. The report says so whenever those datasets are present, and it lists any family dataset the engine does not compute as not compared. - Stale-success dependency. RAS Mapper can exit successfully after
skipping an area. The harness detects this independently by overwriting the
stored products before each native run. The matching fix in
RasMap.recompute_property_tables(), which requires each area's "tables complete" report, is in a separate change. - 1D, storage, pipe and pump coverage. The harness compares each
generated dataset with native HEC-RAS, including its dtype and shape, and
the attributes of each connectivity group. Native 1D tables and
connectivity come from a geometry-only plan compute; native pipe tables and
pump cells from a forced mesh rebuild. Pinned pipe products are retained.
The stage-C pump records (
Geometry/GeomPreprocess) of a pipe geometry are not rebuilt by the engine's writer; HEC-RAS rewrites them at plan compute. - User Manning's n regions. Compared, not written (see What the engine computes).
- LC hash.
Property Tables LC Hashis kept from the source, not recomputed (see Currency attributes). Use a source geometry HDF that native preprocessing left current, and check the compute messages for "Mesh property tables are current".
Exceptions¶
| Exception | Raised when |
|---|---|
RustPreprocessNotFoundError |
The engine executable cannot be located |
RustPreprocessRefusedError |
The engine refuses the input; .refusal holds its message and .report the engine's JSON report (with components and refused). .reason is "unqualified-geometry-components" for the geometry scope check (.components lists each refused component with its id and count), "pipe-network-file-version" for a pipe network outside HEC-RAS 7.0.2, "1d-tables-refused" when a 1D section, cell or junction cannot be reproduced, and "no-2d-flow-areas" for a geometry without 2D areas, cross sections or pipes. Preprocess such a geometry with native HEC-RAS |
RustPreprocessError |
Unsupported geometry File Version with require_supported_version=True, unsupported geometry state, an engine build without the geometry scope check, engine failure, failed product validation, a read-only in-place target, missing engine writer scripts for 1D or pipe products (RAS_COMMANDER_PREPROCESS_SCRIPTS), an unrecomputed native value in the harness, or no checked HEC-RAS installed when hecras_version is not given |
See the geometry API reference for signatures and result classes.