Skip to content

Statically-compilable ISO lowers for Date, DateTime, and Time - #476

Merged
quinnj merged 3 commits into
masterfrom
jq/trim-temporal-lowers
Aug 8, 2026
Merged

Statically-compilable ISO lowers for Date, DateTime, and Time#476
quinnj merged 3 commits into
masterfrom
jq/trim-temporal-lowers

Conversation

@quinnj

@quinnj quinnj commented Aug 7, 2026

Copy link
Copy Markdown
Member

Temporal values lowered through the generic StringLike path — string(x) — which routes into the Dates format machinery: rpad/repeat padding and type-info printing are dynamic, so writing any Date/DateTime/Time field failed juliac --trim=safe verification. The trim workload had no temporal field, which is how it slipped through.

This emits exactly string(x) through fixed-format printers instead:

  • Date: signed, ≥4-digit years ("-0001-01-01", "12345-01-01")
  • DateTime: fraction omitted at zero milliseconds, always three digits otherwise ("…T00:00:00", "…T00:00:00.010")
  • Time: tiered subsecond field (ms/µs/ns) with trailing zeros stripped ("01:02:03.01"), matching print(::IO, ::Time)

Parity is fuzz-tested against string(x) across 60k random values plus the edge tiers, and the trim workload now round-trips a temporal struct.

Ordering: the workload's typed reads need the matching lift fix in JuliaServices/StructUtils.jl#68; this PR's trim test project pins StructUtils = \"2.8.4\", so that PR wants to land and release first.

Found while updating the JuliaCon workshop app to the registered stack (a 62MB from-scratch native image now builds clean against these two fixes with no app-side serialization workarounds).

🤖 Generated with Claude Code

…Time

Temporal values lowered through the generic StringLike path — string(x) —
which routes into the Dates format machinery: rpad/repeat padding and
type-info printing are dynamic, so writing any Date/DateTime/Time field
failed juliac --trim=safe verification. The trim workload had no temporal
field, which is how it slipped through.

Emit exactly string(x) through fixed-format printers instead: signed
wide years, DateTime's fraction omitted at zero milliseconds and three
digits otherwise, and Time's tiered subsecond field with trailing zeros
stripped. Parity is fuzz-tested against string(x) across all field
combinations, and the trim workload now round-trips a temporal struct
(reads require StructUtils 2.8.4, pinned in the trim test project).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.78788% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.98%. Comparing base (c59e2cc) to head (1e36d84).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/write.jl 78.78% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #476      +/-   ##
==========================================
- Coverage   90.49%   89.98%   -0.51%     
==========================================
  Files           7        7              
  Lines        1452     1518      +66     
==========================================
+ Hits         1314     1366      +52     
- Misses        138      152      +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@quinnj
quinnj merged commit 1e36d84 into master Aug 8, 2026
9 of 11 checks passed
@quinnj
quinnj deleted the jq/trim-temporal-lowers branch August 8, 2026 21:05
quinnj added a commit to quinnj/juliacon-2026-workshop that referenced this pull request Aug 10, 2026
The native build now rides four upstream fixes instead of app-side
serialization code. JSON writes Date/DateTime/Time through fixed-format
ISO printers (JuliaIO/JSON.jl#476) and StructUtils hand-parses ISO 8601
in its temporal lifts, accepting RFC 3339 offsets on DateTime normalized
to UTC (JuliaServices/StructUtils.jl#68) — both pinned until released.
Registered HTTP 2.6.2 and JuliaC 0.3.8 trim-verify clean, so those pins
and the trim_strict_bodies preference go away entirely.

What remains native-specific is structural, not serialization: the
webhook endpoint is not registered (the image runs no event runtime),
and the stored-summary disk mirror still flattens one nesting level —
typed parsing of doubly-nested shapes awaits
JuliaLang/julia#62661.

juliac --trim=safe verifies with zero errors; the 62MB from-scratch
container serves the generated typed client end to end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
quinnj added a commit to quinnj/juliacon-2026-workshop that referenced this pull request Aug 10, 2026
The native build now rides four upstream fixes instead of app-side
serialization code. JSON writes Date/DateTime/Time through fixed-format
ISO printers (JuliaIO/JSON.jl#476) and StructUtils hand-parses ISO 8601
in its temporal lifts, accepting RFC 3339 offsets on DateTime normalized
to UTC (JuliaServices/StructUtils.jl#68) — both pinned until released.
Registered HTTP 2.6.2 and JuliaC 0.3.8 trim-verify clean, so those pins
and the trim_strict_bodies preference go away entirely.

What remains native-specific is structural, not serialization: the
webhook endpoint is not registered (the image runs no event runtime),
and the stored-summary disk mirror still flattens one nesting level —
typed parsing of doubly-nested shapes awaits
JuliaLang/julia#62661.

juliac --trim=safe verifies with zero errors; the 62MB from-scratch
container serves the generated typed client end to end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
quinnj added a commit to quinnj/juliacon-2026-workshop that referenced this pull request Aug 10, 2026
The native build now rides four upstream fixes instead of app-side
serialization code. JSON writes Date/DateTime/Time through fixed-format
ISO printers (JuliaIO/JSON.jl#476) and StructUtils hand-parses ISO 8601
in its temporal lifts, accepting RFC 3339 offsets on DateTime normalized
to UTC (JuliaServices/StructUtils.jl#68) — both pinned until released.
Registered HTTP 2.6.2 and JuliaC 0.3.8 trim-verify clean, so those pins
and the trim_strict_bodies preference go away entirely.

What remains native-specific is structural, not serialization: the
webhook endpoint is not registered (the image runs no event runtime),
and the stored-summary disk mirror still flattens one nesting level —
typed parsing of doubly-nested shapes awaits
JuliaLang/julia#62661.

juliac --trim=safe verifies with zero errors; the 62MB from-scratch
container serves the generated typed client end to end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants