Skip to content

native: Drama 3's CUDA settings get table rows, so its open no longer panics - #2658

Merged
ashhart merged 2 commits into
mainfrom
lead/drama-env-rows
Nov 9, 2026
Merged

ashhart merged 2 commits into
mainfrom
lead/drama-env-rows

Conversation

@ashhart

@ashhart ashhart commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Since 6a1feb2 (in 1.2.5), cuda_device.setting reads through the strict environment table. TF_DRAMA_PREFILL_ROWS and TF_DRAMA_REFERENCE_CACHE had no rows. So every CUDA Drama 3 open reached rule()'s "unregistered strict environment parser" panic, whether or not either variable was set (drama_open.zig:44,50 → cuda_device.setting → environment.parse → rule).

The change

  • Both names get .u32 rows trimmed of spaces, as their old reader was.
  • The rows are in a new drama3 scope, which the startup check doesn't include. drama_open keeps its own bounds (1 through 1024 rows; 0 through 16 entries) and its own messages.
  • setting() now takes its name at compile time. environment.registered stops the build on a name with no row, so this can't recur through setting.
  • The one input change: text of only tabs or line breaks was refused by the old reader and now reads as unset, like every other table setting. docs/environment.md says so, next to the Gemma 4 exception.

Checked

  • test-environment-host, test-environment-report-host and check-native-cuda-host (the Linux CUDA server, compiled on macOS) pass.
  • With the TF_DRAMA_PREFILL_ROWS row removed, check-native-cuda-host stops with TF_DRAMA_PREFILL_ROWS has no row in platform/environment.zig.
  • check-drama-cuda-host does not reach drama_open.zig, so the server compile is the one that guards it.

Thanks to @Bizuayeu for #2591, which set out the table's blank-text convention this follows.

… panics

6a1feb2 sent cuda_device.setting through the strict environment table.
TF_DRAMA_PREFILL_ROWS and TF_DRAMA_REFERENCE_CACHE had no rows, so every
CUDA Drama 3 open reached rule()'s "unregistered strict environment parser"
panic, set or not.

Both get .u32 rows trimmed of spaces, as their old reader was, in a new
drama3 scope that the startup check leaves alone; drama_open keeps its own
bounds and messages. setting() now takes its name at compile time and the
build stops on a name with no row, so this cannot recur through it.

Text of only tabs or line breaks, which the old reader refused, now reads
as unset like every other table setting; docs/environment.md says so.
@ashhart
ashhart force-pushed the lead/drama-env-rows branch from 27fe9c1 to 83bea7d Compare November 9, 2026 07:55
@ashhart
ashhart merged commit d94a100 into main Nov 9, 2026
3 of 10 checks passed
ashhart added a commit that referenced this pull request Nov 9, 2026
…the backend gate

GLM's env_defaults_test module takes core and canon beside cuda and heat,
as main's GLM CUDA module has them: Settings.read now reaches cuda_l2pf.zig
and the weight, format and shard files that import them.

Drama's two settings read through the environment table since #2658, so a
word in TF_DRAMA_PREFILL_ROWS is refused with the table's text, which the pin
now expects; a new pin covers TF_DRAMA_REFERENCE_CACHE's default and its
refusal past 16, and the table cases add the values only drama_open bounds.

The flag-deps pin parsed --backend mlx everywhere, but off macOS a test
root's build serves auto and cuda (cli.zig backend_values), so it failed on
Linux; it now takes each build's own backend and refuses the other.
ashhart added a commit that referenced this pull request Nov 9, 2026
…the backend gate

GLM's env_defaults_test module takes core and canon beside cuda and heat,
as main's GLM CUDA module has them: Settings.read now reaches cuda_l2pf.zig
and the weight, format and shard files that import them.

Drama's two settings read through the environment table since #2658, so a
word in TF_DRAMA_PREFILL_ROWS is refused with the table's text, which the pin
now expects; a new pin covers TF_DRAMA_REFERENCE_CACHE's default and its
refusal past 16, and the table cases add the values only drama_open bounds.

The flag-deps pin parsed --backend mlx everywhere, but off macOS a test
root's build serves auto and cuda (cli.zig backend_values), so it failed on
Linux; it now takes each build's own backend and refuses the other.
ashhart added a commit that referenced this pull request Nov 9, 2026
…the backend gate

GLM's env_defaults_test module takes core and canon beside cuda and heat,
as main's GLM CUDA module has them: Settings.read now reaches cuda_l2pf.zig
and the weight, format and shard files that import them.

Drama's two settings read through the environment table since #2658, so a
word in TF_DRAMA_PREFILL_ROWS is refused with the table's text, which the pin
now expects; a new pin covers TF_DRAMA_REFERENCE_CACHE's default and its
refusal past 16, and the table cases add the values only drama_open bounds.

The flag-deps pin parsed --backend mlx everywhere, but off macOS a test
root's build serves auto and cuda (cli.zig backend_values), so it failed on
Linux; it now takes each build's own backend and refuses the other.
@ashhart
ashhart deleted the lead/drama-env-rows branch November 10, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant