Skip to content

[Vulcan] Reject unsupported component-date calendar boundaries - #374

Open
iliaal wants to merge 1 commit into
masterfrom
vulcan/component-date-boundaries
Open

iliaal wants to merge 1 commit into
masterfrom
vulcan/component-date-boundaries

Conversation

@iliaal

@iliaal iliaal commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Fix

Apply #356's calendar boundary policy to packDateValues(), the remaining component-based sibling. LibXL packs 1899-12-31 as serial 1 (1900-01-01), while early dates in the 1904 system produce negative or time-only serials.

  • Nonzero calendar dates with years 1–1899 now warn for invalid year and return false; previously they could return colliding/negative values. Existing rejection of years below 1/above INT_MAX remains.
  • Calendar results below 1 now return false, including 1904-01-01 in the 1904 system.
  • Explicit all-zero date fields retain time-only values. Invalid-time validation order, LibXL month/day normalization (e.g. February 30) and Excel's fictitious 1900 leap day remain unchanged. This is not full Gregorian validation.

Validation

PHP 8.4.26 NTS / LibXL 5.2.0.1, direct strict GCC build, zero warnings:

  • Baseline 274 PHPTs passed / 7 expected skips. Final 275 passed / 7 skips / 0 failures or warnings. New PHPT 280 fails on base; 200 exact-output repetitions pass on final.
  • Independent mutants fail: excel.c:3568, year < 1900 → year < 1; excel.c:3587, removing the calendar dt < 1 condition and retaining only dt == -1.
  • XLS/XLSX × both date systems cover first supported serials, rejected boundaries, explicit times, preserved normalization and warning order. Component checks also run in 32-bit CI; only pre-epoch timestamp round-trips are gated. No local 32-bit claim.
  • 20 existing literal date tuples extrapolated across four configurations: 76/80 identical, four 1901 dates deliberately applied to the 1904 system now reject negative serials. No live customer workbooks examined: latent boundary hardening, not observed incidents.
  • 36 guard fixtures, documentation PHP lint, whitespace, merge-tree and independent review passed. All own open PRs refreshed; no same-repo overlap. All 36 applicable current-default CI jobs passed.

Sibling sweep: shared _php_excel_date_pack already guards timestamp packing and single/bulk AS_DATE writes; explicit time-only packing and unpacking remain unchanged. Unreleased Fixed follows #356; no released sections or generated arginfo changed.

Local skips include licensed-only, optional benchmark, ZTS and Windows coverage; hosted CI now also passed its phpize/configure and multi-version LibXL lanes. New test is discovered by native Tests and Windows PHPT lanes.

CI: all 37 applicable jobs passed on exact head 16a45214032925be323a1cdc74f726f65d94d4b9: 15 Tests jobs (run 44329610907), 21 Windows jobs (run 44329610842), and Changelog guard (run 44329610847). Release attachment and peer recheck were conditionally skipped, not counted as passes.

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