WIP: feat(tensor): Tensor<Scalar> over a Buffer #695
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/691-tensor-core"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #691
Depends on https://git.torb.dev/torbscript/language/pull/706
Step 2 of #82, slice 1 of docs/design/TENSOR.md: the package
std/tensorwithTensor<Scalar: Numeric = Float>over aBuffer<Scalar>, dense and row-major.extents,strides,offset,storage(the field isextents, notshape, because a field and the membershape()collide); a negative extent panics withthe extent -1 of axis 0 is negative.scalar,zeros,ones,filled,identity,of,over(no copy); zero-sized and rank-0 shapes as in decision 4.shape,rank,count,isDense,get(Option),Index/MutableIndexonList<Int>with the decision-6 panics,Iteratein row-major order,Show, layout-independentEquals.std/tensor/testsfor Float64, Int and Fixed (34 in the VM), conformance programstensor-index-panicandtensor-extent-panicfor the panic messages.docs/standard-library/tensor.md, regenerated index andskills/.tensor-zerosandtensor-indexwith their hand-written partners andtools/tensor-cost.sh(a measurement step in gates.yml, not a gate).Compiler dependency
Tensoris the first type to overrideIterate.count. That exposed a dispatch bug inmemberInValue(a call ofList.countthrough a trait-typedList<T>landed on the walking default, which madestd/htmlquadratic). The fix is no longer part of this PR: it is #705, PR #706, with its own regression tests. This branch carries no change undercompiler/src; it is rebased onto #706 once that is merged, and stays a draft until then.compiler/tests/boxed-updates.test.trbstays here:List.setmoves from member 10 to 11 becauseTensoroverrides a default and the witness table ofListholds every overridden default, independent of the dispatch fix.Benchmarks (CI tier B, linux-x64, run 2520, fastest of 9)
tensor-zerosis within the 1.10 bound, so no native is added.tensor-indexgoes through the genericIndexonList<Int>per element; its cost is recorded for the next slices (views, a fast path for fixed rank).Notes: the non-dense gather path of
items()has no test yet, since this slice builds only dense tensors (views come with the next slices). Native tests could only run in CI (no C compiler in the sandbox). Seed untouched. The.pdisc-sidecar.yamlheader comment is restored to the main version.Allocation budget:
tests/conformance/collection-words.allocationsgoes from 212 to 213 (one block).collection-wordsdoes not useTensor; the program measured 213 blocks in tier B oncestd/tensoris part of the std tree. That measurement was taken with the dispatch fix in the branch, so it is re-checked on the rebase onto #706 and adjusted to what CI measures then.std/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691std/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691std/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691std/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691std/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691std/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691dd7ca583e1034a467c4bstd/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691std/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691034a467c4b563f5b8d4e563f5b8d4e41dc1979destd/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691WIP: feat(tensor): Tensor<Scalar> over a Bufferto feat(tensor): Tensor<Scalar> over a Buffer41dc1979debf84b025b6bf84b025b6329ac411c7std/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691Changes requested on
329ac41. CI is green, the package itself looks right (invariants, panic messages, tests on Float64/Int/Fixed, conformance programs, docs), but the diff contains a compiler change that the task and the PR body exclude.compiler/src/ir/witness.trb(memberInValuenow skips slots for which the newisShadowedByreturns true, +21 lines) changes how member calls are dispatched through witness tables, andcompiler/tests/boxed-updates.test.trbshifts an expected member number from 10 to 11 because of it. The PR body says "The slice changes no compiler or runtime code", and #691 says: "If a checker or compiler gap shows up, file it as its own issue and do not fix it here." Please move the fix into its own issue and PR (Conventional Commitfix(ir): ...) and rebase this one on it; or, if it cannot be separated, say so explicitly in the body with the failing case it fixes and why it cannot wait.boxed-updates.test.trb; nothing exercises the new rule (aList.countcall must not land on the walkingIterate.countdefault once some type overridescount). That case needs a regression test (a conformance program or compiler test that fails without thewitness.trbchange) in the PR that carries the fix.tensor-zeros/tensor-index; the body says "see the CI log below", but nothing follows and there is no comment. Add the measured ratios (and, iftensor-zerosexceeds 1.10, say so) to the body..pdisc-sidecar.yamlheader comment changed (openclaw/skills/...toopenclaw/skills-package/skills/...): a side effect of the generator, harmless, but unrelated to this slice.Non-blocking: the
collection-words.allocations212 to 213 raise is explained in the body; please re-check it after item 1, since the extra block may depend on the dispatch change.Checklist: tests ok (34 in the VM, CI tier A/B green for this head), CI ok, security/secrets ok, data ok, docs ok (page, index, skills regenerated), scope not ok (item 1), acceptance not ok (item 3).
329ac411c7ac911352bbfeat(tensor): Tensor<Scalar> over a Bufferto WIP: feat(tensor): Tensor<Scalar> over a BufferAddressed the review on
329ac411, new headac911352:memberInValuefix is gone from this branch (no change undercompiler/srcany more). It lives in #705 / PR #706 with its regression tests (compiler/tests/default-shadow.test.trb, conformancelist-count-shadow). This PR is a draft and depends on #706; it is rebased onto it once #706 is merged, then review is re-requested..pdisc-sidecar.yamlheader comment restored to main.boxed-updatesmember 10 to 11 stays here: it comes fromTensoroverriding a default, not from the dispatch fix. Thecollection-wordsbudget is re-checked against CI after the rebase onto #706.Still a draft: blocked on PR #706 (fix(ir) for #705), which is open and itself a draft; owner orion, this PR is rebased onto it and review re-requested once #706 is merged.
Still a draft (2026-11-01 03:25): blocked on PR #706 (fix(ir) for #705), open and a draft with a test-only head whose red
default-shadowrun is not yet confirmed; owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-02 00:45): blocked on PR #706 (fix(ir) for #705), still open and a draft with tier A red on
cd4125b7(lane output lost, cause unconfirmed); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-02 10:10): blocked on PR #706 (fix(ir) for #705), unchanged since 00:45 (open, draft, head
cd4125b7, tier A red, lane output lost); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-02 14:15): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red, lane output lost); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-02 18:20): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-02 22:55): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-03 04:10): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-03 08:25): blocked on PR #706 (fix(ir) for #705), unchanged since 04:10 (open, draft, head
cd4125b7, tier A and gates red, not mergeable); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-03 12:30): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, CI failure, not mergeable); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-03 16:35): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red, not mergeable); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-04 00:20): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red, not mergeable); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-04 07:30): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red, not mergeable); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-04 12:50): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red, not mergeable); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-04 22:45): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red, not mergeable); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-05 04:10): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red, not mergeable); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.Still a draft (2026-11-05 14:55): blocked on PR #706 (fix(ir) for #705), unchanged (open, draft, head
cd4125b7, tier A and gates red, not mergeable); owner orion (loop/705), no Torben decision needed. This PR is rebased onto #706 and review re-requested once #706 is merged.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.