Method and boundaries
Calculate, Evidence, Interpret, Validate
This page sets out how we cast a chart and how we read it, which conventions we adopt, where the schools genuinely disagree, and what we deliberately do not do. It should be checkable, not marketing copy.
The four-layer pipeline
- 01Calculate
Calculate: the chart is produced by an algorithm
Calendar conversion, the instants of the solar terms, time zones, true solar time correction, the stems and branches of the four pillars, hidden stems, and the direction and start time of the luck cycles are all computed by deterministic algorithms and written into structured fields. The language model takes no part in this step and is not allowed to infer the four pillars directly from a birth date.
- 02Evidence
Evidence: every conclusion must be able to list its grounds
Day-master strength, the configuration of the ten gods, combinations, clashes, punishments and harms, climate adjustment and structural patterns are all emitted as individually checkable evidence items: which month command, which rooting point, which stem or branch was triggered. Scores are only the internal expression of that evidence, not the judgement itself.
- 03Interpret
Interpret: the AI handles the wording, not the computation
The language model turns structured evidence into a readable explanation and states the conditions under which a conclusion holds. Where the schools disagree, we name the disagreement and the priority we currently apply, rather than packaging one reading as the single correct answer.
- 04Validate
Validate: consistency and boundary checks before output
Once an explanation is generated, we check whether it can be traced back to structured evidence items, and we filter high-risk content against the topic boundaries. The consistency check — that the useful god, favorable god, unfavorable god and enemy god are pairwise distinct — is a hard constraint in the selection layer: where the climate-adjustment table's auxiliary element collides with “what generates the unfavorable god”, it is reassigned by function, and we run a regression over all 120 day-master × month-branch combinations.
Engine version and changelog
Every algorithm fix that changes computed output bumps the engine version and is recorded here. A saved chart whose version no longer matches the current one is treated as stale and recomputed — using the same birth details stored alongside it, so conventions such as true solar time are not lost. In the rare case where an early record lacks the fields needed (year, month, day, hour, minute) it cannot be recomputed faithfully, so we keep the original chart rather than guess at one. Copy and layout changes do not bump the version.
Changelog
- v52026-09-25
Almanac auspicious hours now use the twelve day-officers
Affects: Almanac
Auspicious hours were previously inferred from whether the day had more 宜 (suitable) entries than 忌 (avoid) entries. That heuristic was directionally wrong: on 2026-09-25 it listed five inauspicious (黑道) hours as auspicious and marked the day's only 青龍 auspicious hour (庚子) as inauspicious. Auspicious hours now follow the yellow-path/black-path (黃道/黑道) property of the twelve day-officers. When the engine cannot compute them it returns a degraded flag and the page says so rather than inventing hours. The same day, two byte-identical almanac implementations (web and engine package) were merged into one so the two runtimes cannot disagree.
- v42026-09-20
Year pillar now switches at 立春; leap-month charts cached separately
Affects: BaZi · Zi Wei Dou Shu
The year pillar used to change over at the lunar new year (正月初一), which produced a wrong year pillar for anyone born between 立春 and the lunar new year. It now switches at 立春 (the start of spring). Separately, the Zi Wei Dou Shu cache key now includes isLeapMonth — leap-month and ordinary-month charts previously shared one key and could contaminate each other, which is why the cache version moved from v3 to v4.
- v32026-09-20
Hour stem now derived by the five-rat rule (五鼠遁)
Affects: BaZi
The hour stem was offset for some hours. It is now derived from the day stem using the five-rat rule (五鼠遁) throughout.
- v22026-09-20
Fixed a crash in computeBaziAccurate for certain inputs
Affects: BaZi
Certain combinations of birth information made the chart function throw, which took down the whole result page.
- v12026-09-20
Introduced engine versioning (backfilled starting point)
Affects: All
There was no version concept before this; cache invalidation relied on manually editing a string. v1 is a backfilled starting point so later versions have a reference.
Reproducible verification
These numbers can be reproduced directly — the commands live in the repository. We also pin known deviations with tests: a test list that only reports passes is not informative; one that states exactly where we differ is.
- Engine regression tests (divination-core, bun test)
- 110
- Web and mobile tests (bun test lib apps/mobile) · 29 files
- 215
Total: 325 · 2026-09-29
What the tests pin down
- Day-pillar anchor: 1949-10-01 = 甲子. The old implementation returned 庚申/戊子 and drifted with the host time zone.
- Every 子 hour's stem follows the five-rat rule. The old implementation got the stem wrong for *every* 子 hour because of a rotated-array index error (a 癸 day's 子 hour should be 壬子; it returned 甲子).
- The year pillar switches at 立春, not at the lunar new year.
- Leap-month birthdays must land on the leap month itself. Measured on 2023 leap second month, day 20: the old implementation was 30 days off and placed palaces differently in the second half of the leap month.
- **Known deviations are pinned explicitly**: 23:00 does not roll the day pillar (early/late 子 hour is a genuine school disagreement; BaZi here uses the 子正 rollover), and solar-term day boundaries use an approximation table rather than a second-precise solar-term instant. These are known, test-recorded behaviours — not undiscovered defects.
Passing tests show the implementation matches the conventions we state. They are not evidence that the method itself is scientifically validated.
The conventions we adopt
BaZi has several traditional practices that are equally well grounded. Our principle is to fix one set, record it, and let you check it, rather than using different rules on different pages.
- Time basis
- By default we use the clock time you enter. True solar time is an optional correction: it is adjusted by longitude and the equation of time only when it is enabled and a birthplace longitude has been provided, and the adjusted time is recorded in the result.
- Year-pillar boundary
- It switches at the exact instant of 立春 (Start of Spring). We use neither 1 January nor the lunar New Year.
- Month-pillar boundary
- It switches at the exact instant of the twelve 節 (solar terms) and is unrelated to the lunar month.
- Zi-hour day rollover
- Whether late 子時 (the zi hour) counts as the current day or the next day is a school difference, and both practices have their users. Our implementation fixes one rule and stays consistent with it; if you are used to the other, the day pillar and the ten gods shift as a whole, which you can use to check the difference.
- Strength and element selection
- Support-and-restraint (扶抑) and climate adjustment (調候) are computed separately, and **both layers are shown in the chart results**. When they point in different directions we name the disagreement, say which layer we currently take, and explain why. The difference is not an error: support and restraint asks whether the day master can carry the chart, climate adjustment asks about the season's cold, heat, dryness and damp — two different questions.
- Borderline charts
- Day-master strength sums several weighted factors into a raw score, then bands it at 75 / 60 / 40 / 25. When the raw score lands within 3 points of a threshold we flag it directly in the results, in two grades: those where crossing switches to a different derivation (the five roles change), and those that change only the band name. The grades are not inferred — the selection branches are extracted into a pure function evaluable at a hypothetical grade, so we compute the full set of five roles (useful / avoid / favourable / hostile / idle) on both sides of the threshold and compare them character by character. On our own sample, about 40% of charts land within 3 points of some threshold.
What we do not do
Health
We do not provide illness diagnoses, judgements about physical condition, or treatment advice. For health concerns, consult a qualified medical professional.
Investment and finance
We do not provide buy or sell points for stocks, funds or cryptocurrencies, and we do not predict specific prices. Base financial decisions on regulated financial information.
Legal
We do not provide legal opinions, and we do not predict the outcome of litigation.
Personal safety
We make no assertions about danger, accidents or lifespan; for anything involving safety, seek professional help in the real world.
Major life decisions
We do not treat a divination conclusion as the sole basis for decisions such as marriage, emigration or resignation.
Deterministic prediction
We do not promise the date or outcome of specific events. In our framing, BaZi is a traditional-culture reference framework, and we do not claim that it has the validity of modern science.
Known limitations
- When the birth time is inaccurate, conclusions that depend on the hour pillar become markedly less reliable — especially close to an hour or solar-term boundary.
- School differences cannot be “solved”, only explained. We mark them where they exist rather than hide them.
- We do flag borderline charts, but **flagging one does not make its conclusion robust**: when the score sits close to a threshold, a different set of weights can produce the opposite useful element, and that uncertainty cannot be removed — only stated. Whether crossing changes the useful element is **worked out chart by chart**, not estimated — though it is still only the answer under our current conventions.
- For a few climate-adjustment combinations the enemy-god label is assigned by a functional fallback (the classical auxiliary element is kept as the favorable god), so it differs slightly from the strict “what generates the unfavorable god” definition; with such combinations, treat the “basis for selection” as authoritative.
- AI explanations can drift in wording. If a statement cannot be traced to grounds in the evidence layer, treat the chart and the evidence fields as authoritative.
- We accept corrections: if you find an error in the chart calculation or in the rules, submit it through our feedback channel and we will fix it in a later version.
Frequently asked questions
Can the AI get my BaZi chart wrong?
The chart is produced by deterministic algorithms and written into structured fields, so it can be checked item by item. The AI only handles the explanation layer, so a chart error and an explanation error are two different classes of problem: the first can be reproduced and verified, the second can be reviewed through the evidence layer.
Why not just have a large model cast the chart directly?
Calendar conversion, the instants of the solar terms and time-zone correction depend on precise rules and historical data, which a language model cannot reproduce reliably. Handing deterministic computation to an algorithm is the key to reducing non-reproducible errors.
Your result differs from my teacher's — who is right?
In most cases the conventions differ rather than one side being wrong. The usual sources of difference are whether true solar time is enabled, the zi-hour day-rollover rule, the strength weightings, and the framework used to select useful elements. You can check these item by item; we publish the rules we use on this methodology page.
How do you handle school differences?
We name the disagreement and the priority we currently apply. Both the support-and-restraint and climate-adjustment layers are computed and shown in the results: when they agree, that tells you the conclusion is corroborated by two independent routes; when they differ, we state what each derives, which layer we take, and why.
What if the two layers contradict each other?
Pairwise distinctness of the useful, favorable, unfavorable and enemy gods is a hard constraint in the selection layer, with regression coverage across all 120 day-master × month-branch combinations; if two of them ever coincide we treat it as a defect and fix it.
Do you treat the results as scientific prediction?
No. In our framing, BaZi is a traditional-culture reference framework; we make no assertion about its scientific status, and we do not encourage using it in place of professional judgement in real life.
Related entries
Method and boundaries · 2026-09-20