R/Bootstrap.R:22 — sample(deindexedChars, replace = TRUE) is subject to the classic base-R sample() gotcha: when deindexedChars has length 1 and holds a value k, sample() treats it as sample(1:k, ...) rather than sampling the single value k itself. Essentially unreachable with normal phyDat weights (which rarely produce a length-1 deindexedChars), but a one-line fix.
Verified REAL (haiku verifier, code-read).
Fix: use sample.int-based indexing, or wrap with the standard idiom (x[sample.int(length(x), ..., replace=TRUE)]) that avoids the vector/scalar ambiguity.
Filed by /red-team area 14 (opus finder, 2026-08-05).
R/Bootstrap.R:22—sample(deindexedChars, replace = TRUE)is subject to the classic base-Rsample()gotcha: whendeindexedCharshas length 1 and holds a valuek,sample()treats it assample(1:k, ...)rather than sampling the single valuekitself. Essentially unreachable with normal phyDat weights (which rarely produce a length-1deindexedChars), but a one-line fix.Verified REAL (haiku verifier, code-read).
Fix: use
sample.int-based indexing, or wrap with the standard idiom (x[sample.int(length(x), ..., replace=TRUE)]) that avoids the vector/scalar ambiguity.Filed by /red-team area 14 (opus finder, 2026-08-05).