A length-1 R vector is marshalled as a scalar, so a one-dimensional IVP is rejected with a message about the wrong argument
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Start by tracing how the R binding marshals numeric vectors in value_new, then inspect argument validation for num_ode_dopri5 and num_ode_rk4_adaptive. The report shows array(x, dim = 1) works around the issue, but leaves open whether to preserve length-1 vectors as tensors or correct argument error reporting; confirm the intended behavior with maintainers before changing it.
Written by the indexing model from the issue text.
Description
A length-1 numeric vector becomes a scalar Float, so a one-dimensional IVP — the commonest ODE there is — cannot be passed to num_ode_dopri5 / num_ode_rk4_adaptive in the obvious way, and the error blames an argument the caller never wrote.
library(rssn)
s <- rssn_session()
value_kind(value_new(c(1), s)) # "float"
value_kind(value_new(array(1, dim = 1), s)) # "tensor"
value_kind(value_new(c(1, 2), s)) # "tensor"
f <- function(t, y) -y
call_value("num_ode_dopri5", 0, 1, c(1), 1e-6, 1e-6, 0.1, 1000, f, session = s)
# Error: argument 2 has type Float, expected Tensor<Float[E], 1>
call_value("num_ode_dopri5", 0, 1, array(1, dim = 1), 1e-6, 1e-6, 0.1, 1000, f, session = s)
# ok
c(1, 2) is a tensor and c(1) is a scalar, so the kind depends only on the length, and the message then refers to "argument 2" — which is t1, the second parameter, while the offending value is the third (y0). A caller reading the error looks at the wrong argument.
The same applies to every operator whose signature asks for Tensor<_, 1>: c(1) is silently demoted before the call is made, so the shape check can never see it.
Expected: keep a length-1 vector a rank-1 tensor (a dim attribute already does it, so the information is there when the caller supplies it), or report the mismatch against the argument that actually failed, naming the workaround (array(x, dim = 1)).
rssn 0.3.0, R 4.6.2 binding, Windows x86_64.
- Dominant language
- Rust
- Stars
- 36
- Forks
- 3
- Avg merge
- 14h 51m
- Merged PRs (30d)
- 29
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Apich-Organization/rssn
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothOpenarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#383 ·
Maintainers usually reply within 1 day
-
area/numerical good first issue help wanted kind/doc-mismatch severity/5-trivial
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Apich-Organization/rssn#373 ·
Maintainers usually reply within 1 day
-
area/numerical good first issue help wanted kind/doc-mismatch severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#371 ·
Maintainers usually reply within 1 day
-
json_encode() re-emits a decoded empty JSON object as [], so {} and {"":1} are not round-trip stableOpenarea/api-bindings good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#361 ·
Maintainers usually reply within 1 day
-
area/statistics good first issue help wanted kind/wrong-result severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Apich-Organization/rssn#362 ·
Maintainers usually reply within 1 day
All issues in Apich-Organization/rssn
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
autofixer: follow-up triage: bug triage: classified triage: correctness triage: has-reproducer
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
tursodatabase/turso#13221 ·
Maintainers usually reply within 1 day
-
Update Wasmtime to 48.0.11 for RUSTSEC-2026-0648Possibly taken @flyingrobots claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
flyingrobots/edict#457 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day