Sexagenary Day Cycle Validation
Validate the sixty-day stem-branch cycle with canonical ordering, adjacent-day invariants, verified anchors and boundary-focused test cases.
Overview
The sexagenary day cycle pairs the ten Heavenly Stems with the twelve Earthly Branches in their canonical order. Because both sequences advance together and repeat after their least common multiple, only sixty parity-compatible pairs occur. A trustworthy Day-Pillar engine does more than return a familiar label: it proves that adjacent effective days advance one index, sixty days return to the same pair, dates before the anchor wrap correctly, and leap days or civil-calendar reforms do not create a skipped or duplicated cycle position. Time-zone and Bazi day-boundary decisions must be resolved before this invariant is applied.
At a glance
- Stem sequence
- 10 Heavenly Stems
- Branch sequence
- 12 Earthly Branches
- Joint period
- 60 ordered pairs
- Adjacent-day rule
- Advance exactly one cycle index
- Round-trip rule
- A 60-day offset returns the same pair
- Applied after
- Calendar, time-zone and day-boundary resolution
The sixty valid pairs come from two synchronized sequences
The stem and branch indexes both advance by one each day. Their combined state repeats after sixty steps, the least common multiple of ten and twelve.
This construction preserves yin-yang parity: yang stems pair with yang branches and yin stems with yin branches. A parity-incompatible pair signals corrupted data or an incorrect independent lookup.
- Use the canonical stem and branch orders.
- Reject impossible parity pairings.
Local invariants expose most indexing defects
For every effective date, the next day must advance one pair and the previous day must retreat one pair. Adding or subtracting sixty days must preserve the pair, including across a civil month or year change.
These checks reveal negative-modulo mistakes, zero-versus-one-based indexes and leap-day handling errors more reliably than a small table of isolated examples.
- Test both forward and backward dates.
- Include leap-year and year-end transitions.
An independently checked anchor fixes the cycle to chronology
The repeating structure alone cannot tell which pair belongs to a particular historical day. At least one externally verified anchor is required, and multiple distant anchors help detect a calendar conversion or epoch mistake.
Record the anchor’s source calendar, time basis and index convention. A correct pair attached to the wrong civil-day boundary is not a valid anchor for the implementation.
- Use more than one independent reference date.
- Version the anchor and epoch contract.
Resolve the effective Bazi day before testing the cycle
A birth near local midnight or a school’s 23:00 day change may belong to different effective dates under different declared methods. Historical time-zone offsets and ambiguous clock readings can also move the instant across a boundary.
Calculate each supported convention explicitly, then apply the same sixty-day invariant to each candidate. Never change the anchor to force agreement with a preferred interpretation.
- Separate time resolution from cycle indexing.
- Return labeled candidates when the input straddles the boundary.
Sources and editorial basis
- Hong Kong Observatory: Heavenly Stems and Earthly Branches香港天文台列明十天干、十二地支與六十干支的標準循環,支持陰陽配對、相鄰日遞進與六十日回歸規則An official modern reference for the canonical stem and branch orders, the sexagenary cycle, and calendrical use.
- OpenFate Editorial Methodology產品以多個外部基準日、雙向日期、閏日、跨年、歷史曆法與日界案例作不變式測試,不以單一查表結果代替算法驗證OpenFate separates deterministic chart calculation, traditional interpretation, and modern editorial explanation.