Methodology
What paircast actually computes
Every BaZi compatibility app says "real engine, not AI hallucination." We owe you proof. This page lists every rule, table, and formula our engine applies — sourced directly from production code so what you see here is what runs.
1 · From birth date to four pillars
Your birth date + time + city goes through three steps:
- True solar time correction — if you supplied a birth city, we adjust your clock time by (longitude − standard meridian) × 4 minutes. Singapore at 103.85°E vs the GMT+8 standard meridian (120°E) means ~−65 minutes. A child born at clock-time 12:30 in Singapore was at true solar time ~11:25, which can land in a different 时辰 (2-hour pillar) entirely.
- Solar → Lunar conversion — via a peer-reviewed astronomical calendar engine that encodes the official 节气 (solar term) boundaries used by 协纪辨方书.
- Pillar resolution — year, month, day, and hour pillars are read from the lunar calendar. Each pillar is a stem + branch pair (天干 + 地支). The 60-jiazi cycle is deterministic; given the same corrected datetime, every BaZi tool produces the same four pillars.
2 · The ten stems and twelve branches
Every chart is built from these 22 symbols. The element + polarity for each is what drives all downstream computation.
Heavenly stems (天干)
| Stem | Element / Polarity |
|---|---|
| 甲 | 木 (yang) |
| 乙 | 木 (yin) |
| 丙 | 火 (yang) |
| 丁 | 火 (yin) |
| 戊 | 土 (yang) |
| 己 | 土 (yin) |
| 庚 | 金 (yang) |
| 辛 | 金 (yin) |
| 壬 | 水 (yang) |
| 癸 | 水 (yin) |
Earthly branches (地支)
| Branch | Element | Zodiac |
|---|---|---|
| 子 | 水 | 鼠 |
| 丑 | 土 | 牛 |
| 寅 | 木 | 虎 |
| 卯 | 木 | 兔 |
| 辰 | 土 | 龙 |
| 巳 | 火 | 蛇 |
| 午 | 火 | 马 |
| 未 | 土 | 羊 |
| 申 | 金 | 猴 |
| 酉 | 金 | 鸡 |
| 戌 | 土 | 狗 |
| 亥 | 水 | 猪 |
3 · Day Master, strength, and the Use God
The "Day Master" (日主) — the stem of your day pillar — represents you. Three things determine how the rest of the chart relates to it:
- Strength — how strong the day-master's element is in the chart, weighted by pillar position. Month branch carries the most weight (×1.6 for branch element, ×1.0 for stem). Categories: 旺, 偏旺, 中和, 偏弱, 弱.
- Use God (用神) — the element that helps your day master most. Weak DM → use the element that generates you. Strong DM → use the element that controls you, or the one your DM controls. This single value drives most compatibility scoring.
- Favourable God (喜神) — a secondary helper element. Carries half the weight of the use god in compatibility scoring.
4 · Five-Element relations
The relations between the five elements are deterministic. They drive shi-shen (Ten Gods), compatibility scoring, and the year-by-year outlook.
| Relation | Cycle |
|---|---|
| Generates (生) | 木 → 火 → 土 → 金 → 水 → 木 |
| Controls (克) | 木 → 土, 土 → 水, 水 → 火, 火 → 金, 金 → 木 |
5 · The Ten Gods (十神)
A stem's "Ten God" label describes its relationship to your day master, derived from element relation + polarity. Five relations × 2 polarities = 10 labels:
| Relation | Same polarity | Different polarity |
|---|---|---|
| Same element | 比肩 | 劫财 |
| I generate | 食神 | 伤官 |
| I control | 偏财 | 正财 |
| Controls me | 七杀 | 正官 |
| Generates me | 偏印 | 正印 |
6 · Chart pattern (命格)
We classify every chart into one of eleven patterns by looking at the month branch's main qi (本气) and its Ten God relation to your day master:
| Pattern | Trigger |
|---|---|
| Direct Officer (正官格) | 月令本气为正官 |
| Seven Killings (七杀格) | 月令本气为七杀 |
| Direct Wealth (正财格) | 月令本气为正财 |
| Indirect Wealth (偏财格) | 月令本气为偏财 |
| Direct Resource (正印格) | 月令本气为正印 |
| Indirect Resource (偏印格) | 月令本气为偏印 |
| Eating God (食神格) | 月令本气为食神 |
| Hurting Officer (伤官格) | 月令本气为伤官 |
| Established Rank (建禄格) | 月令本气为日主比肩 |
| Month Blade (月刃格) | 月令本气为阳日主之劫财 |
| Sibling-Rival (比劫格) | 阴日主月支比劫(月刃以外的情况) |
For earth-branch (辰/戌/丑/未) months — known as 杂气 (mixed-qi) months — we also check whether a secondary hidden stem is "transparent" (appears as a visible stem elsewhere in the chart); if so, the pattern upgrades to that stem's Ten God.
7 · The 21 Shen Sha we check
Shen Sha are auspicious / inauspicious stars whose positions are looked up from classical tables. paircast checks 21 of them — many apps stop at 5-6. Each has a one-line interpretation that the LLM uses when narrating the reading. Rules sourced from 三命通会 / 神峰通考 / 协纪辨方书; where sources disagree we picked the most-cited modern form.
Auspicious nobles
| Name | What it means |
|---|---|
| Heavenly Noble (天乙贵人) | Heavenly Noble — protective allies in adversity, social leverage. |
| Heavenly Virtue Noble (天德贵人) | Heavenly Virtue Noble — generous nature, virtue draws fortune. |
| Monthly Virtue Noble (月德贵人) | Monthly Virtue Noble — gentle disposition, broad goodwill. |
| Fortune Star Noble (福星贵人) | Fortune Star Noble — deep good fortune, smooth life path. |
| State Seal Noble (国印贵人) | State Seal Noble — natural authority, suited to public roles. |
| Wenchang (文昌) | Wenchang — intellectual aptitude, excels in scholarship. |
| Taiji Noble (太极贵人) | Taiji Noble — metaphysical insight, can defuse danger. |
| Lu Star (禄神) | Lu Star — stable provisions, self-reliant, steady income. |
Relationship / honour stars
| Name | What it means |
|---|---|
| Peach Blossom (桃花) | Peach Blossom — charm and romantic appeal; watch for entanglements. |
| Red Bird (红鸾) | Red Bird — marriage and romance favorable. |
| Heavenly Joy (天喜) | Heavenly Joy — celebrations, family additions, partnerships. |
| Travel Star (驿马) | Travel Star — change-favoring, gains through movement. |
| General Star (将星) | General Star — leadership and command presence. |
| Golden Carriage (金舆) | Golden Carriage — virtuous spouse, prosperous marriage. |
Cautionary stars
| Name | What it means |
|---|---|
| Red Glamour (红艳煞) | Red Beauty — magnetic, prone to emotional drama. |
| Solitary (孤辰) | Solitary — needs personal space, prone to feeling alone. |
| Widowed Lodge (寡宿) | Widowed Lodge — late marriage tendency, emotional voids. |
| Goat Blade (羊刃) | Goat Blade — sharp, decisive, watch for conflict. |
| Robber Star (劫煞) | Robber Star — watch for sudden losses and disruptions. |
| Loss Star (亡神) | Loss Star — deep-thinking, guard against sabotage and lows. |
| Flowing Glow (流霞) | Flowing Glow — classical caution sign (modern: figurative). |
8 · True solar time correction
Time zones are political; the sun is not. Cities far from their timezone's standard meridian see a meaningful gap between clock time and solar time. paircast applies the flat-longitude correction used by 子平 practitioners:
offsetMinutes = (longitude − standardMeridian) × 4
24 cities are pre-loaded; the table below covers the ones most relevant to the Chinese diaspora:
| City | Longitude | Standard meridian | Offset (min) |
|---|---|---|---|
| Singapore | 103.85°E | 120°E | -65 |
| Kuala Lumpur | 101.69°E | 120°E | -73 |
| Johor Bahru | 103.74°E | 120°E | -65 |
| Penang | 100.33°E | 120°E | -79 |
| Kota Kinabalu | 116.07°E | 120°E | -16 |
| Kuching | 110.34°E | 120°E | -39 |
| Jakarta | 106.85°E | 105°E | +7 |
| Bangkok | 100.50°E | 105°E | -18 |
| Hong Kong | 114.17°E | 120°E | -23 |
| Macau | 113.55°E | 120°E | -26 |
| Taipei | 121.56°E | 120°E | +6 |
| Kaohsiung | 120.30°E | 120°E | +1 |
DST handling is deliberately out of scope for v1 — the SG/MY/HK/CN/TW target market doesn't observe DST. US/UK/AU users who observed DST at the time of birth would need to adjust their clock-time entry manually.
9 · How the compatibility score is computed
The 0–100 compatibility score is the sum of six independent components, each scored against its own maximum. The LLM never decides the score — it only narrates the engine's output.
| Component | Max | What it rewards |
|---|---|---|
| Use-God complement | 25 | How much each partner's chart contains the other's use god + favourable god |
| Five-Element balance | 15 | How well the merged five-element distribution covers all five elements |
| Day-pillar (marriage palace) | 20 | Branch relation between day pillars: 六合/三合 + ; 冲 − |
| Cross-pillar interactions | 15 | All 16 pillar-pair stem + branch relations, summed |
| Zodiac (year-branch) | 10 | Year-branch harmony / clash — the simplest layer |
| Shen Sha cross-influence | 15 | Auspicious / cautionary stars in both charts that bear on the relationship |
10 · The 5-year couple outlook
Each year in the 5-year heatmap gets a 0-100 score, computed independently for each partner against the year's 流年 (year ganzhi), then averaged. Per-partner deltas added to a base of 50:
| Factor | Delta |
|---|---|
| Day-branch 六合 / 三合 | +14 / +10 |
| Day-branch clash | −15 |
| Day-branch 刑 / 害 | −8 each |
| Same branch | +6 |
| Year stem = use god | +10 |
| Year stem = favourable god | +5 |
| Year stem opposes use god | −8 |
Final per-year score is clamped to [5, 95] so extremes feel earned and pure 0/100 never appears. The four per-quarter sub-scores apply small modifiers based on the seasonal branches (寅 spring, 巳 summer, 申 autumn, 亥 winter).
11 · How the date picker scores a candidate day
The picker scores each candidate day against both partners' charts. Hard taboos (day-pillar clash, Yáng-gōng forbidden day) downgrade the band even if the numeric score is high. For wedding purpose specifically, weights are:
| Factor | Delta |
|---|---|
| Day branch clashes either day branch | −32 |
| Day branch harmonises with day branch | +22 |
| Day branch clashes a year branch (zodiac clash) | −16 |
| Day stem matches mutual use god | +16 |
| Day ganzhi is in 不将日 table | +10 |
| 三娘煞 lunar day (3 / 7 / 13 / 18 / 22 / 27) | −14 |
| 杨公十三忌 | −12 |
Other purposes (engagement, ROM, moving-in, business launch, conception) share the same scaffolding with adjusted weights — for example, business launch drops marriage-specific terms (不将日, 三娘煞) and emphasises the use-god match factor.
12 · The boundary between engine and LLM
We use a frontier reasoning model to write the 6,500-word reading. Here's a clear line for what it does and doesn't decide:
| The engine decides | The LLM decides |
|---|---|
| The four pillars (year, month, day, hour) | Tone, voice, paragraph structure |
| The 0-100 compatibility score and each sub-component | Which examples to use, which metaphors to reach for |
| Day master strength + use god + favourable god | How to weave the structured data into a 13-section narrative |
| The chart pattern (命格) classification | Specific behavioural suggestions for the couple |
| Which Shen Sha hit, on which pillars | Plain-language translation of dense classical terms |
| DaYun + LiuNian sequence and stem-shishen labels | Which yearly trends to highlight and emphasise |
| Date-picker scores + bands | (date picker outputs are LLM-free) |
If the LLM started inventing rules — claiming, say, that one stem-pair combination implies a specific marriage outcome — that's a violation of the boundary. We test the prompt to keep it grounded; the engine numbers do the talking.
Verify it yourself
Drop in two birth dates and see the structured output this page describes — chart pillars, scores, the lot — before any AI prose. The free reading exposes every number we just listed.