core: the second lane's scratch region sized by the ops it may issue

A program naming a buffer to rad_buf_concurrent got two scratch regions of the program's largest kernel
scratch each, though by Ctx::lane1_ rule 3 an op on the second lane touches only rad_buf_concurrent
buffers. Program::scratch_bytes_lane1 is the largest device scratch of such an op (or one naming no
transient buffer); the Arena takes per-region sizes, arena_plan_bytes counts them for the VRAM budget,
and Ctx::issue refuses a larger lane-1 request by name instead of overrunning the region. Qwen3.8 with
its drafter: region 1 0 B instead of 50 MiB (17 MiB without speculation).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
mici81andClaude Opus 5.5 authored and StillDeadcode committed 2026-10-24 11:10:08 +02:00
1 parent 5838c25343
commit 0c813784a0
8 files changed
+125 -15

No files matched your search

+5
View File
@@ -458,6 +458,11 @@ public:
* region safely through in-order launch; a second lane is a second stream and needs its own.
* Two when the architecture declared a buffer rad_buf_concurrent. */
int32_t scratch_regions = 1;
/* Region 1's size when there are two: the largest device scratch of an op the second lane may
* issue. By Ctx::lane1_'s rule 3 such an op touches only rad_buf_concurrent buffers, so an op
* with any other transient buffer never runs there; one naming no transient buffer counts.
* At most scratch_bytes; -1 (a program not built by the Builder) means scratch_bytes. */
int64_t scratch_bytes_lane1 = -1;
/* Everything that resolved to nothing, reported whole rather than stopping at the first
* failure (spec §3.1). Structured because the domains are reported differently: a device miss