Skip to content

infinityabundance/checknow-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

checknow-rs

A faithful Rust port of upstream checknow.awk — the IANA tzdb zonenow.tab consistency checker. It reads a zdump -i transition table (the actual behaviour of each compiled zone over a time window) and verifies that every zonenow.tab entry has zdump data, no two entries are identical from now on, and every distinct behaviour is represented. Diagnostics go to stdout with an exit status (0 = clean).

It is a source-QA layer of the Rust tzdb toolchain:

ziguard-rs    source-profile transform
zishrink-rs   compact-source emission
checktab-rs   table consistency checker
checklinks-rs Zone/Link graph checker
checknow-rs   zonenow.tab consistency checker   <- this crate
zic-rs        compilation to TZif
zdump-rs      behaviour witness

checknow-rs does not define tzdb policy or civil-time truth — it reproduces the upstream check.

Install / use

cargo install checknow-rs
checknow-rs --tzdb-dir .                          # zic + zdump + both checks (like `make now.ck`)
checknow-rs --zdump-table now.tab zonenow.tab     # one check (mirrors awk -v zdump_table=…)

The time dependence lives entirely in the zdump -i table (produced over a zic-compiled tree); checknow-rs takes that table as a given, so feeding the same table to both awk and this crate is deterministic.

Correctness — how it's proven

The verdict (stdout + exit) matched against the real awk oracle:

  • Pinned 2026b (tests/oracle.rs): both the now and 1970 checks yield the pass verdict (exit 0, no output) over frozen zdump -i tables, byte-for-byte == awk -f checknow.awk. Admitted source ffad46a0… + OpenPGP GOODSIG.
  • Negative fixtures (tests/cases.rs): 4 cases (zone with no data, two zones identical from now on, uncovered zone, baseline) — each reproduces awk's exact stdout and exit.
  • All IANA releases (reports/release-all/): checknow.awk + zonenow.tab are a 2023d addition, so 8 of 48 bundles are runnable; over all 8, checknow-rs reproduces the 2026b-checknow verdict set (8/8, zero port bugs); 6 reproduce the release's own checknow.awk byte-for-byte; 2 are check evolution.
  • Kani (reports/kani/): the $3 field access is total. Fuzzing (reports/fuzz/): 313,177 runs, 0 crashes.
cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test

What this does and does not claim

It claims: to reproduce the 2026b checknow.awk verdict (diagnostics + exit) for admitted releases, and byte-exact output where the upstream check is unchanged.

It does not claim: to define tzdb policy or civil-time truth, be a stricter checker, or reproduce older releases' verdicts when the check differs. The END coverage loop sorts for determinism (gawk uses hash order); the verdict set is identical.

Zero runtime dependencies. #![forbid(unsafe_code)].

License

Apache-2.0. Upstream checknow.awk is in the public domain (Paul Eggert); independent Rust reimplementation.

About

Faithful Rust port of IANA tzdb checknow.awk — zonenow.tab consistency checker (now-through-28-years zdump verification)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors