sim_params() reports no parameters for 11 scenarios that sim_run refuses to run without them, and reports ising's as a nested struct the runner rejects

Open
#375 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
r, rust
Domain
api, backend

Research direction

Start by tracing the R binding entry points sim_params() and sim_run() and how they obtain scenario parameter definitions; compare the catalog with the runner requirements for the 12 named scenarios. Check the related issue #352 for context. Done means all 29 scenarios expose the fields, types, and defaults the runner accepts, and the examples in the issue work or report missing arguments by name.

Written by the indexing model from the issue text.

Description

area/simulation good first issue help wanted kind/contract severity/3-major

sim_names() lists 29 scenarios and sim_params(name) is the only way to learn what to pass to sim_run(name, ...). For 12 of them the catalog and the runner disagree, and 11 cannot be run at all from R because the catalog reports no parameters.

library(rssn)
sim_params("fdtd")
# list()                      -- no parameters at all

sim_run("fdtd")
# Error: invalid parameters: invalid length 0, expected struct FdtdParameters with 5 elements at line 1 column 2

The error names a Rust struct and a field count, never the fields, so there is nothing the caller can do with it. The same happens for:

scenario sim_params() sim_run()
fdtd list() expected struct FdtdParameters with 5 elements
geodesic list() expected struct GeodesicParameters …
gpe list() expected struct GpeParameters …
elasticity list() expected struct ElasticityParameters …
lid_driven_cavity list() expected struct NavierStokesParameters …
channel_flow list() expected struct ChannelRequest …
schrodinger list() expected struct SchrodingerRequest …
ising_wolff list() expected struct WolffRequest …
sod_shock_tube list() expected struct SodRequest …
kepler_symplectic list() expected struct KeplerRequest …
nbody_gravity list() expected struct NbodyRequest with 5 …

ising is the twelfth, with the opposite failure — the catalog reports a nested object, and the runner wants flat fields:

sim_params("ising")
# $params$type    "ising_statistical::IsingParameters"
# $params$default NULL
# $seed$type      "int|null"

sim_run("ising", params = list(width = 8, height = 8, temperature = 2, mc_steps = 10))
# Error: invalid parameters: missing field `width` at line 1 column 63

sim_run("ising", width = 8, height = 8, temperature = 2, mc_steps = 10)
# ok

So the documented shape is the one that fails, and the undocumented flat shape is the one that works. This is the R-side twin of #352 (the C++ run_scenario rejects the nested params object that kScenarios advertises).

By contrast the other 18 scenarios are fine: sim_params gives named defaults (poisson_multigrid → dim, n, sigma, cycle, tol) and sim_run(name) with no arguments succeeds, so the mechanism works — the table is just incomplete for the 12 above.

Expected: sim_params() names every field the runner requires (with its type and default) for all 29 scenarios, so sim_run(name) works or a missing argument is reported by name.

rssn 0.3.0, R 4.6.2 binding (sim_names/sim_params/sim_run), Windows x86_64.

Dominant language
Rust
Stars
36
Forks
3
Avg merge
14h 51m
Merged PRs (30d)
29

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Apich-Organization/rssn

All issues in Apich-Organization/rssn

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.