[PR #561] [CLOSED] fix: --dump-logits must not promise rows it will never write #2691

Closed
opened 2026-11-04 02:02:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/561
Author: @constantindjonkam
Created: 10/2/2026
Status: ❌ Closed

Base: main ← Head: pr/4-dump-logits-header


📝 Commits (1)

  • be84def fix: --dump-logits must not promise rows it will never write

📊 Changes

1 file changed (+16 additions, -6 deletions)

View changed files

📝 src/program/generate.cpp (+16 -6)

📄 Description

What

--dump-logits promised rows it never wrote.

A native pack leaves the per-token loop at

if (native_pack) { spec_pos = pos; break; }

before the site that dumps a row per position, but the header was written at open. The file claimed
64 or 66 rows and contained none - and a reader that trusted it reported "0 differing
positions"
from a file with no positions in it, which is the one answer that looks like a pass.

The header is now written with the first row. A run that dumps nothing leaves an empty file,
which is what actually happened, and a reader can treat size zero as "this mode never dumps" rather
than as agreement.

Verified

On the native pack the file is now 0 bytes where it was 8. The non-native path is unchanged apart from
when the header lands, and was not exercised here - no non-native model is set up on the machine
this was measured on.

Split out of

#463, which had grown two unrelated fixes. This one is
self-contained and independent of it.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/561 **Author:** [@constantindjonkam](https://github.com/constantindjonkam) **Created:** 10/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/4-dump-logits-header` --- ### 📝 Commits (1) - [`be84def`](https://github.com/Niko1221/Strata/commit/be84defd7819dbc80fccd4d430011b7a182653b5) fix: --dump-logits must not promise rows it will never write ### 📊 Changes **1 file changed** (+16 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/program/generate.cpp` (+16 -6) </details> ### 📄 Description ## What `--dump-logits` promised rows it never wrote. A native pack leaves the per-token loop at if (native_pack) { spec_pos = pos; break; } before the site that dumps a row per position, but the header was written at open. The file claimed 64 or 66 rows and contained **none** - and a reader that trusted it reported **"0 differing positions"** from a file with no positions in it, which is the one answer that looks like a pass. The header is now written **with the first row**. A run that dumps nothing leaves an **empty file**, which is what actually happened, and a reader can treat size zero as "this mode never dumps" rather than as agreement. ## Verified On the native pack the file is now 0 bytes where it was 8. The non-native path is unchanged apart from *when* the header lands, and was not exercised here - no non-native model is set up on the machine this was measured on. ## Split out of [#463](https://github.com/Niko1221/Strata/pull/463), which had grown two unrelated fixes. This one is self-contained and independent of it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:02:24 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2691
No description provided.