feat(std/transform): 2D transforms and propagation (step 3a of #89) #780
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!780
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/779-std-transform-2d"
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?
Adds the package
std/transform(2D half of #89), importing onlystd/core,std/number,std/linearandstd/ecs.Transform2<Scalar: Real = Float>(translation, rotation, scale;Equals, Show;identity) withcomposed(child),inverse(): Self?(None on a zero scale),interpolated(toward:, by:)(rotation the short way, including the pi seam) andtoMatrix3().GlobalTransform2<Scalar>holding aMatrix3(a non-uniform parent scale over a rotated child shears, which a decomposed transform cannot hold), withidentity,transformedPoint,transformedDirection.propagate(locals, var globals, parents, order): one pass over thedepthOrderlist; global = parent's global matrix times owntoMatrix3(); an entity without parent, or whose parent has no global, uses its own matrix. Plain function overStore<Transform2>/Store<GlobalTransform2>, registered by the program in its ownSchedule(pattern indocs/standard-library/transform.md).FloatandFixed.Tests:
std/transform/tests(26 tests: arithmetic, reverse-order chain, non-uniform root scale with rotated child, no parent, parent without global, Float run, hand-computed Fixed chain); conformancetransform-propagate(rotate-root + propagate system in aSchedule, four frames) andtransform-propagate-cycle(panics throughdepthOrder).Docs:
docs/standard-library/transform.md, index and ecs.md entries, regeneratedskills/, landed notes indocs/design/ECS.md(header, sections 7, 11, 13).Deviations and open points:
composed(child), notcomposed(with:):withis a keyword and cannot be a parameter name.composedis exact for a uniform parent scale, documented as such.Fixedtrig is inexact (sine(0) is -1 raw), so rotation-dependent test values useisCloseTowith 66 raw units; the conformance output is deterministic integers..expectedand the leak run (358 passed); the only failure was the missing budget, now committed astests/conformance/transform-propagate.allocations(2446 blocks, from that run). The cycle program has none, likeecs-parent-cycle.torb docs check docs --no-nativereports 14 problems in other pages (nightly vs. main diagnostic wording), none in the touched pages.Closes #779
Refs #89
std/transform2D:Transform2,GlobalTransform2and propagation (step 3a of #89) #779Review of
e234aea. CI is green for this head, but green here does not cover the new conformance program (see 1).Checklist
FloatandFixedruns.composed,interpolated(short way over the seam) andpropagate(parent global times own matrix, depth order fromdepthOrder, cycle panics there) match the PR body and #779 R1-R5.composed(child:)instead ofcomposed(with:)is a justified deviation (withis a keyword).std/linearandstd/ecs.skills/, ECS.md notes; pdisc green.Findings
tests/conformance/transform-propagate.allocationsis missing. The program exits 0 and has a leak run, so pertests/conformance/README.md("A program with a leak run and no.allocationsfile fails and prints its count") tier B fails on it. Tier B was skipped on this PR by design (ci.yml: it runs on a PR only whencompiler/src/ir,compiler/src/backend,runtime/,tools/or.forgejo/change), so this PR's CI can never produce the number the body says it waits for, and nothing here ran the native leg. Tier B runs on every push tomain, so merging as is turnsmainred. Every non-panickingecs-*program (ecs-data,ecs-schedule) carries its.allocations. Please obtain the count from a linux x86_64 run with a C compiler (sh tools/conformance.sh --filter transform-propagate --update-budgets, or a CI run where tier B is active) and commit the file in this PR, and note in the PR body that the native leg and the leak run were green. If the byte-for-byte VM/native agreement of.expectedfails there, regenerate it from that run.Non-blocking
Transform2.inversedoc: only the example is given; state next to the "uniform scale" caveat (as incomposed) that with a non-uniform scale and a nonzero rotation the result is not the exact inverse (GlobalTransform2matrices are, viaMatrix3).I will re-check the new
.allocationsfile and the PR body on the next head; the rest is approved as it stands.Re-review of
ccea1f3(changes sincee234aea:fab41fbinverse doc,ccea1f3temporary tier B trigger). CI is red on this head; the causes are below. The tier B run did what it was for.Earlier finding
.allocationsmissing): still open. Tier B on this head reportstests/conformance/transform-propagate.trb: has no allocation budget, allocated 2446 blocks. It is the only conformance failure (358 passed, 1 failed), so the VM/native leg of.expectedagrees. Notests/conformance/transform-propagate.allocationsis in the diff yet.inversedoc is addressed infab41fb.Findings
tests/conformance/transform-propagate.allocationswith the count from this run (2446, or the valuesh tools/conformance.sh --update-budgets --filter tests/conformance/transform-propagate.trbgives where a C compiler exists). Update the PR body: the native leg and the leak run were green on the tier B run of this branch, and drop the "comes from the first CI run" deviation.doc --check --no-run std:std/transform/src/transform2.trb:70: [GlobalTransform2] does not resolve here. It comes from the doc paragraph added infab41fb: that file imports onlyReal,Equals, ShowandAngle, Vector2, Matrix2, Matrix3, andGlobalTransform2lives in./global. Name something this file declares or imports (for example "the global matrices, as [Matrix3] inverts them"), or write it in plain code font instead of a link. This is the only red gate in tier A; everything else there passed.# tier B trigger (temporary, dropped before review)from.forgejo/workflows/ci.yml. It is still in the head and the commit message says it is temporary. Dropping it is the point of that commit, so please make it the last commit (or squash it away), thengatesshould be green on a head that matches what merges. Note: with it gone tier B no longer runs on the PR, which is fine once finding 1 is in.Everything else from my first review stands as approved. I will re-check the three points above on the next head.
ccea1f33ad24f5bf51b3Re-review of
24f5bf5(changes sinceccea1f3:24f5bf5). CI is green for this head, including tier B (30m) and tier A.Earlier findings
.allocationsmissing: fixed.tests/conformance/transform-propagate.allocations(2446) is in the diff, matching the count from the earlier tier B run; tier B is green on this head.[GlobalTransform2]link intransform2.trb: fixed. Theinversedoc now links[Matrix3], which the file imports; tier A (doc --check) is green..forgejo/workflows/ci.ymlis no longer in the diff.Checklist
transform-propagateandtransform-propagate-cycle; native leg and leak run green.propagateis one pass overdepthOrder(parent global times own matrix; no parent or no parent global uses own matrix); cycles panic indepthOrder.std/core,std/number,std/linear,std/ecs.skills/, ECS.md notes; pdisc green.Approved; merging by rebase.
std/transform2D:Transform2,GlobalTransform2and propagation (step 3a of #89) #779std/transform3D,Transform3,GlobalTransform3and 3D propagation (step 3b of #89) #787std/ecswith oneStoreper group type, andstd/transform(ECS slice 1) #89std/ecswith oneStoreper group type, andstd/transform(ECS slice 1) #89std/transform3D,Transform3,GlobalTransform3and 3D propagation (step 3b of #89) #787