You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ty_holds skips a closure in a later instance of the same datatype #1513
Build and run the program below on the CPU and Metal lanes:
bend main.bend -o main
./main --gpu off
./main --gpu on
What happened
The file checks, and JS and the native CPU lane print 42. Metal fail-stops with:
bend: a function the device does not hold
ty_holds sees Box<Num{}> first and records Box in seen, so it does not inspect the fields of the later Box<Fun{}> instance. Pick(Fun{}) and its function are therefore missed. Reversing the two fields of Duo, so Box<Fun{}> comes first, makes Metal print 42.
This looks like a remaining case after #1336: the Tag argument has a value-taking kind and is skipped, but its value selects the type-family result stored in Box.value.
Reproduced on current main at d71f42ee287bd7b9f86b44df44b210ac5eb651bd.
The focused fix tracks active datatype expansions rather than retaining names across siblings. Refreshed onto current main 381dc87 (including #1506 and #1509), the original closure-bang repro prints 42 on native CPU. Actual emitted-C CUDA preprocessing shows the host-minted closure FID 4 absent from the device evaluator on current main (which retains its missing-function error default) and included with the fix. Seventeen existing/new closure and current plain-number Nat seam cases pass; the repository gate passes 54/54. Removed my obsolete BigInt seam regression after #1506 changed the host contract to numbers. Preparing the PR with the original GPU regression; no Metal/CUDA hardware execution or performance claim.
Activity
oxura commentedon Oct 12, 2026
The focused fix tracks active datatype expansions rather than retaining names across siblings. Refreshed onto current main 381dc87 (including #1506 and #1509), the original closure-bang repro prints 42 on native CPU. Actual emitted-C CUDA preprocessing shows the host-minted closure FID 4 absent from the device evaluator on current main (which retains its missing-function error default) and included with the fix. Seventeen existing/new closure and current plain-number Nat seam cases pass; the repository gate passes 54/54. Removed my obsolete BigInt seam regression after #1506 changed the host contract to numbers. Preparing the PR with the original GPU regression; no Metal/CUDA hardware execution or performance claim.
ty_holds keys an instance by its value arguments (#1513)
ty_holds keeps the name key; a datatype met again with other argument…
ty_holds keys a datatype by its value arguments; type arguments are l…
ty_holds opens a datatype once with DUMMY for its value arguments (#1513
ty_holds opens with DUMMY only when p takes an unknown type as a hit (#…
ty_holds opens with DUMMY only for the device's closure query (#1513)
ty_holds opens a datatype once per value arguments (#1513)
ty_holds keys an instance by its raw value arguments, widening past 2…
ty_holds fits comp.ts back under its ttok cap (#1513)
ty_holds reads a kind re-entered mid-walk as values, opens 64 instanc…
ty_holds: a widened walk takes a stuck type as the datatype it names (#…
ty_holds: key instances by value arguments 8 calls deep, then by name (…
ty_holds: an instance that re-enters its family with a grown index is…
ty_holds opens a datatype once with DUMMY for its value arguments (#1513