Skip to content

fix(offset): match GNU timezone behavior - #358

Open
anastygnome wants to merge 1 commit into
uutils:mainfrom
anastygnome:split/offset
Open

anastygnome wants to merge 1 commit into
uutils:mainfrom
anastygnome:split/offset

Conversation

@anastygnome

@anastygnome anastygnome commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Preserve named-zone provenance so local abbreviations retain DST-aware behavior when applicable.
  • Parse and normalize larger numeric offsets safely, including overflow validation.
  • Keep fixed offsets anchored before relative adjustments.

@codspeed

codspeed Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 4.59%

1 warning

⚠️ 14 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

❌ 9 regressed benchmarks
✅ 12 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ parse_epoch_timestamp 11.6 µs 12.5 µs -7.55%
❌ parse_datetime_with_tz_name 62.2 µs 67.2 µs -7.47%
❌ parse_date_slash_format 27.2 µs 28.4 µs -4.12%
❌ parse_iso_datetime 40.4 µs 42.1 µs -4.06%
❌ parse_iso_datetime_t_separator 40.5 µs 42.2 µs -4.04%
❌ parse_datetime_ending_in_z 60.3 µs 62.8 µs -4.03%
❌ parse_date_only 27.9 µs 28.9 µs -3.35%
❌ parse_yesterday 31.1 µs 32.1 µs -3.34%
❌ parse_tomorrow 30.6 µs 31.6 µs -3.23%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing anastygnome:split/offset (18b3fc2) with main (5a1a032)

Open in CodSpeed

@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.32402% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.88%. Comparing base (5a1a032) to head (18b3fc2).

Files with missing lines Patch % Lines
src/items/builder.rs 96.62% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #358      +/-   ##
==========================================
- Coverage   98.91%   98.88%   -0.03%     
==========================================
  Files          21       21              
  Lines        4713     4857     +144     
  Branches      138      144       +6     
==========================================
+ Hits         4662     4803     +141     
- Misses         50       53       +3     
  Partials        1        1              
Flag Coverage Δ
macos_latest 98.88% <98.32%> (-0.03%) ⬇️
ubuntu_latest 98.88% <98.32%> (-0.03%) ⬇️
windows_latest 12.92% <31.84%> (+0.47%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@anastygnome
anastygnome force-pushed the split/offset branch 2 times, most recently from c7366d4 to 7f366f6 Compare November 19, 2026 07:08
@anastygnome

Copy link
Copy Markdown
Contributor Author

@sylvestre can you check real quick

@sylvestre

Copy link
Copy Markdown
Contributor

thanks for looking into this!
This does too much in one PR, and the named-local-zone path drops the GNU day overflow for months/years (see inline).
CodSpeed shows a 5.6% slowdown: matching_local_zone runs strftime on every parse with a named zone. Please fix that and get codecov green.

Comment thread src/items/builder.rs Resolved
Comment thread src/items/builder.rs Resolved
Comment thread src/items/builder.rs Resolved
Comment thread src/items/builder.rs Resolved
Comment thread src/items/builder.rs Resolved
Comment thread src/items/builder.rs Resolved
Comment thread tests/date.rs Resolved
Comment thread src/items/offset.rs Resolved
Comment thread src/items/builder.rs Outdated
let offset_seconds = offset.total_seconds();
let ambiguous = zone.to_ambiguous_zoned_datetime(local);
for candidate in [
ambiguous.clone().compatible(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compatible() is already earlier() or later(), do we need it?

Comment thread src/items/builder.rs Resolved
Comment thread src/items/builder.rs Resolved
@anastygnome

Copy link
Copy Markdown
Contributor Author

@codspeedbot fix this regression

@codspeed

codspeed Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

@codspeedbot fix this regression

Only members of the uutils organization on CodSpeed can ask the performance wizard for help here. Once you've joined it on CodSpeed, comment again.

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