norm() accepts a matrix and builds (list(0, 0)^2 + list(3, 4)^2)^(1/2) instead of computing the Frobenius norm or rejecting the rank
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 67/100
Research direction
Start at the implementation of norm() and its tests; the issue gives reproductions for rank-1 and rank-2 inputs but names no source files or test paths. Trace how the argument rank is checked and how reduction sets reduced and value. Add coverage showing that matrix input either computes the Frobenius norm or returns a clear rank error, while vector cases remain correct.
Written by the indexing model from the issue text.
Description
norm(v) is documented as "Euclidean (L2) norm ||v||_2 of vector v". Given a matrix it does not reject the argument: it squares each row as a number and builds an expression that contains list(...)^2, which is not a well-formed quantity and has no value.
library(rssn)
compute(parse_term("norm(list(list(3,4),list(0,0)))"))$text
# "(list(0, 0)^2 + list(3, 4)^2)^(1/2)"
compute(parse_term("norm(list(list(1,2),list(3,4)))"))$text
# "(list(1, 2)^2 + list(3, 4)^2)^(1/2)"
compute(parse_term("norm(list(list(1,0),list(0,1)))"))$text
# "(list(0, 1)^2 + list(1, 0)^2)^(1/2)"
Each of these reports reduced = TRUE with value = NA, so the caller gets a confidently-reduced expression that no further rule can use. Note the rows come out in reverse order (list(0,0) before list(3,4) for the first matrix), which is a second sign that the arguments were never checked.
The vector case is correct (norm(list(3,4)) is 5), and so is norm(list(1,2,3)) (14^(1/2)), so the defect is specifically that a rank-2 argument is accepted and reduced elementwise-ish instead of being rejected.
Expected: either the Frobenius norm (norm(list(list(3,4),list(0,0))) = 5) or an error naming the argument and the rank it wanted — the same way value_tensor() refuses a non-tensor with "the value is not a tensor". Producing list(0, 0)^2 is the one outcome that cannot be used.
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
-
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
-
approved
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
fritzprix/libr-agent#3266 ·
Maintainers usually reply within 1 day
-
Frame::second_to_frame truncates f32 product, causing periodic off-by-one framesPossibly taken @ShamanicArts claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dmtrKovalenko/fframes#296 ·
Maintainers usually reply within 1 day