Skip to main content
E · Modern conventionChapter 7

Verification & Drik Parity

What this engine’s own test suite checks, the two parity defects it has resolved against Drik Panchang’s published method, and the city-by-city audit that has not been run.

Siddhānta Śiromaṇi (Grahagaṇitādhyāya)Ch. 1, v. 4
A · Canonical text

यद् गणितं दृग्गत्या सह संवदति तदेव शुद्धम्। अन्यद् भ्रममूलम्॥

yad gaṇitaṃ dṛggatyā saha saṃvadati tad eva śuddham | anyad bhramamūlam ||

Translation:That mathematics alone is pure and authentic which agrees perfectly with the visible motion of the heavenly bodies. All other calculation is root error and delusion.

1. What the engine verifies today

ojas-panchang ships its own suite, and it runs with no database, no tenant and no network — which is what lets every calculation be checked in isolation from the product built on top of it.

Classical derivations, pinned

test_drik_parity.py checks Diśā Śūla, Agni Vāsa, Śiva Vāsa, Tārābala, Candrabala, the Ānandādi and Tamil yogas and the Mantri Maṇḍala against values worked out by hand from the classical formula.

The rest of the engine

Festivals, vargas, ṣaḍbala, eclipses, muhūrta, the regional calendars and the saṅkalpa each carry their own tests beside the code they check.

Observational flags

Sunrise uses the Sun’s upper limb with refraction; moonrise uses the disc centre with none. Section 3 is why, and those two lines of the engine are the parity work that has actually been done.

2. The city-by-city audit — not built

There is no harness in this repository that fetches another almanac’s published times and diffs them against ours, city by city. No such comparison has been run, so this chapter publishes no deviation figures and no parity percentage.

Not coming soon: there is no date to promise. Doing it properly means a ground truth nobody disputes, a licence to fetch and republish another publisher’s times, and a rule for telling a genuine disagreement of method — two almanacs can differ on a tithi boundary without either being wrong — from an error. Until those exist, the honest statement is this one.

What can be checked today is in section 1, and what a reader can check themselves is the method: every figure this site computes states the ayanāṃśa, the place and the moment it was computed for.

3. Root-Cause Analyses & Algorithmic Fixes

Issue 1: Moonrise / Moonset Parity Discordance

Root Cause: Early models evaluated Moonrise using solar upper-limb refraction flags. Drik Panchang calculates Moonrise/Moonset strictly for the center of the lunar disc without atmospheric refraction (`swe.BIT_DISC_CENTER | swe.BIT_NO_REFRACTION`).
Fix Applied: Aligned lunar flags and anchored the search domain strictly from local solar sunrise (T_sunrise) to next sunrise (T_sunrise_next).

Issue 2: Fixed 2-Karana Assumption

Root Cause: Static legacy assumptions that every day contains exactly two Karanas failed on fast days with three transitions or slow days near apogee.
Fix Applied: Implemented an iterative while-loop scanning all continuous boundary transitions between T_sunrise and T_sunrise_next.