Every time someone builds an East Asian calendar or Four Pillars of Destiny (BaZi / 四柱推命) feature on top of an LLM, the same pattern repeats: ask a chatbot to calculate a birth chart directly from a date and city, and it replies confidently with four neatly formatted pillars.

The problem is that language models have no built-in astronomical ephemeris. Unless you separate deterministic ephemeris calculation from natural-language interpretation, silent calculation errors happen right on the boundaries that matter most:

  • Start of Spring (立春) — the Year Pillar switches at the exact astronomical solar longitude 315°, not on January 1 or Lunar New Year.
  • The 12 Month-Boundary Solar Terms (十二節) — Month Pillars shift at minute-level UTC instants.
  • True Solar Time (真太陽時) — civil time zones diverge from local solar noon (for example, Tokyo sits at 139.69°E vs the 135°E JST meridian, creating roughly a +19 minute longitude offset before adding the Equation of Time).
  • Late Zi Hour (23:00–23:59) — the Day Pillar advances at 23:00, while Year and Month boundaries still use the actual astronomical instant.
  • Historical Daylight Saving Time — such as Japan's 1948–1951 DST or Taiwan's mid-century DST windows.

While building the calendar engine for Fate Partner (an independent BaZi relationship compatibility platform focused strictly on romantic partnerships), we open-sourced a 100-case universal-UTC boundary benchmark and a <2 ms deterministic MIT MCP server so any agent can stop guessing pillars in token generation.

The 5-Model, 100-Case Benchmark Results (v1.1)

We evaluated 5 zero-tool LLMs on our public dataset (benchmark/bazi-boundary-100.json, v1.1.0), auditing full execution transcripts to ensure zero web search, filesystem, or code-execution tool calls.

To avoid strawmanning, every prompt used an upper-bound explicit-rule protocol: we explicitly supplied city longitude, IANA time zone, TST=YES/NO, and DST/Late-Zi rules. Casual consumer chat prompts without longitude or DST hints exhibit even higher failure rates.

Model / Engine Protocol & Reasoning Budget Exact 4-Pillar Any-Pillar Error LiChun Err (25) 12-Jie Err (25) True Solar Time Err (20) Late Zi Err (15) Historical DST Err (15)
DeepSeek-Chat Non-reasoning API (temp=0, 1/call) 22.0% 78.0% 72.0% 48.0% 100.0% 86.7% 100.0%
Gemini 3.8 Flash (Medium) Zero-tool blind 50×2 (~53k thinking tokens) 56.0% 44.0% 12.0% 48.0% 95.0% 33.3% 33.3%
Claude Sonnet 5.5 (Medium) Zero-tool blind 50×2 (~49k thinking tokens) 84.0% 16.0% 16.0% 32.0% 10.0% 6.7% 6.7%
Claude Opus 5.5 (Medium) Zero-tool blind 50×2 (~38k thinking tokens) 96.0% 4.0% 0.0% 12.0% 0.0% 6.7% 0.0%
Gemini 4 Carbon (Medium) Zero-tool blind 50×2 (~105k thinking tokens / ~18m) 100.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0%
bazi-solar-term-mcp (MIT) Deterministic ephemeris (<2 ms / 0 tokens) 100.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0%

Transparency note on an excluded model: We also tested GPT-OSS 120B (Medium). It declined zero-tool calculation on Attempt 1 and collapsed into repeated placeholder strings (甲子|甲子|甲子|甲子) under 50-case batching on Attempt 2, so we excluded it from the leaderboard instead of inflating our contrast with a broken run.

Three Engineering Takeaways from the Data

  1. Fast / non-reasoning models are unusable for raw calendar math. DeepSeek-Chat missed 100% of True Solar Time cases and 100% of Historical DST cases; Gemini 3.8 Flash still missed 95% of True Solar Time cases and 48% of 12-Jie boundaries.
  2. Even frontier reasoning models pay an absurd latency and token tax. Gemini 4 Carbon reached 100.0% accuracy, but burned 105,418 thinking tokens (~18 minutes) to mentally derive 100 charts that a deterministic function computes in under 2 milliseconds for 0 tokens.
  3. Cross-model auditing actually caught a bug in our own v1.0 ground truth.

The Bug Cross-Model Auditing Caught: Japan Asia/Tokyo (UTC+9) Solar-Term Drift

When we ran the multi-model audit on v1.0.0, top reasoning models systematically disagreed with our ground truth on 10 Japan (Asia/Tokyo, UTC+9) boundary cases.

Digging into the diff exposed a subtle timezone assumption buried in popular calendar libraries: lunar-javascript returns solar-term transition timestamps in UTC+8 (China Standard Time). Comparing a Tokyo wall-clock birthday (UTC+9) naively against a UTC+8 solar-term string silently shifted every Japanese solar-term boundary by 1 full hour.

Astronomically, a solar term occurs at one simultaneous universal UTC instant across the entire planet—whether you are born in Tokyo (UTC+9), Taipei (UTC+8), or New York (UTC-5).

In v1.1.0, we rewrote the Year and Month boundary comparisons in src/engine.mjs to normalize birth time through Node's ICU Intl.DateTimeFormat into exact birthUtcMs, and compare directly against solarTerm.utcMs:

function getYearPillar(birthUtcMs) { const utcYear = new Date(birthUtcMs).getUTCFullYear(); // Compare exact universal UTC instant of birth against exact astronomical LiChun UTC instant. // Solar terms occur simultaneously worldwide regardless of civil time zone (JST/CST/EST/UTC). const lichun = getSolarTermsTable(utcYear).find((j) => j.name === '立春'); const afterLiChun = birthUtcMs >= lichun.utcMs; const baziYear = afterLiChun ? utcYear : utcYear - 1; const idx = (((baziYear - 4) % 60) + 60) % 60; return { gan: ganAt(idx), zhi: zhiAt(idx) }; } 

Meanwhile, Day and Hour Pillars continue to use local True Solar Time (longitude offset + NOAA Equation of Time) after rolling back any historical IANA DST shift. All 100 boundary cases now pass 100/100 across JST, CST, and EST.

Plugging the MIT MCP Server into Claude / Cursor / Codex

The open-source repo (liu17513567-blip/bazi-solar-term-mcp) exposes 3 read-only MCP tools over stdio JSON-RPC 2.0, plus a CLI and a ready-to-use SKILL.md for coding agents:

  1. calculate_bazi_chart — Deterministic Year, Month, Day, and Hour Pillars, Day Master metadata, governing solar term, historical DST rollback, and True Solar Time offset.
  2. check_solar_term_boundary — Returns all 24 astronomical solar terms for a year and flags boundary risk windows.
  3. audit_llm_bazi_answer — Grades any chatbot's claimed pillars against astronomical ground truth and explains which pillar drifted and why.
{ "mcpServers": { "bazi-solar-term": { "command": "npx", "args": ["-y", "bazi-solar-term-mcp"] } } } 

Or run directly from the CLI (no clone needed):

# Calculate a Tokyo chart with True Solar Time calibration npx -y bazi-solar-term-mcp calculate "1992-11-03 00:35" --city Tokyo # Audit a chatbot's claimed Four Pillars npx -y bazi-solar-term-mcp audit "1992-11-03 00:35" 壬申 庚戌 癸未 壬子 --city Tokyo 

Reproduce or Explore Further

If you're working on other domain-specific deterministic MCP servers (calendars, finance, astronomical math, legal deadlines) to eliminate LLM reasoning waste, I'd love to hear how you structure your boundary benchmarks in the comments.