Skip to content

format: an xlsx sheet can be wider than a spreadsheet will open - #93

Merged
donislawdev merged 1 commit into
mainfrom
format/wider-than-a-spreadsheet
Sep 8, 2026
Merged

format: an xlsx sheet can be wider than a spreadsheet will open#93
donislawdev merged 1 commit into
mainfrom
format/wider-than-a-spreadsheet

Conversation

@donislawdev

Copy link
Copy Markdown
Owner

What this is

xlsx offered at most 64 columns. It now offers 32768, which is the ceiling
csv already had for the same question about the same reader.

Why the number

A ceiling belongs to the reader under test, not to what this tool finds
comfortable to write. The old reason was "the width a person would actually
look at" - which describes a document somebody reads, and this tool writes
fixtures somebody tests with. At 64 there was no way to build a sheet that
asks Excel about its own limit at all.

Measured 2026-09-08, LibreOffice Calc 26.2.5.2 headless, on workbooks built
outside this tool because this tool could not build them:

sheet what Calc did
16384 columns comes back whole
16385 columns comes back as 16384, last column dropped, exit 0, nothing said

After the change, a 16385 column workbook from this tool behaves identically,
and hits the requested size to the byte. That silent loss is the thing a
tester needs a fixture for, and standing on both sides of the line is what a
boundary set is.

What did not change

  • The encoder. column() counts letters in base 26, so it walks past XFD on
    its own.
  • rows times columns still cannot pass 2 million cells, so a sheet 16385
    wide holds up to 122 rows.
  • MinBytes, computed from a one by one sheet.
  • The bytes of any sheet of 64 columns or fewer. The default is still one
    column.

The site is regenerated for the two lines that name the range - the whole diff
there is 1 - 64 columns becoming 1 - 32768 columns, and the same in Polish.

Guard

TestAFormatWithColumnsReachesPastWhatASpreadsheetAccepts asks every
registered format that declares columns, so a third tabular format is
covered on the day it arrives. The exception list is empty and is meant to
stay that way - a format belongs on it only when its own structure stops it
first.

It asks about the OFFER rather than building the file. That the file works was
measured rather than asserted on every run, because building one costs twelve
megabytes.

Proven by a mutation putting the ceiling back to 64.

Measured

Full suite green, gofmt and vet clean, preflight all twelve checks passed.

🤖 Generated with Claude Code

xlsx columns stopped at 64, with the reason "the width a person would
actually look at". That describes a document somebody reads, and this tool
writes fixtures somebody tests with - a ceiling belongs to the reader under
test. At 64 there was no way to build a sheet that asks Excel about its own
limit at all, while csv answered the same question about the same reader
with 32768 and nothing compared the two.

Measured 2026-09-08 with LibreOffice Calc 26.2.5.2 headless, on workbooks
built outside this tool because this tool could not build them: 16384
columns come back whole, 16385 come back as 16384 with the last column
dropped, exit 0 and not one word on either stream. After the change our own
16385 column workbook behaves identically, and hits the requested size to
the byte.

The encoder needed no change - column() counts letters in base 26, so it
walks past XFD on its own.

rows times columns still cannot pass 2 million cells, MinBytes is computed
from a one by one sheet so it does not move, and a sheet of 64 columns or
fewer is byte for byte what it was. The site is regenerated for the two
lines that name the range.

The guard asks every registered format that declares columns, so a third
tabular format is covered on the day it arrives. It asks about the OFFER
rather than building the file, because building one costs twelve megabytes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@donislawdev
donislawdev merged commit 1dad937 into main Sep 8, 2026
18 checks passed
@donislawdev
donislawdev deleted the format/wider-than-a-spreadsheet branch September 8, 2026 21:44
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