The topological string partition function Z(λ, t,t) = exp(λ 2g−2 F g (t,t)) is calculated on a compact Calabi-Yau M . The F g (t,t) fulfill the holomorphic anomaly equations, which imply that Ψ = Z transforms as a wave function on the symplectic space H 3 (M, Z). This defines it everywhere in the moduli space M(M ) along with preferred local coordinates. Modular properties of the sections F g as well as local constraints from the 4d effective action allow us to fix Z to a large extent. Currently with a newly found gap condition at the conifold, regularity at the orbifold and the most naive bounds from Castelnuovo's theory, we can provide the boundary data, which specify Z, e.g. up to genus 51 for the quintic.Coupling topological matter to topological gravity is a key problem in string theory. Conceptually most relevant is the topological matter sector of the critical string as it arises e.g. in Calabi-Yau compactifications. Topological string theory on non-compact Calabi-Yau manifolds such as O(−3) → P 2 is essentially solved either by localization 1 -[1] or large N-techniques [2] and has intriguing connections to Chern-Simons theory [3], open-closed string duality [4], matrix models [5], integrable hierarchies of non-critical string theory [6] and 2d Yang-Mills theory [7].However, while local Calabi-Yau manifolds are suitable to study gauge theories and more exotic field theories in 4d and specific couplings to gravity, none of the techniques above extends to compact Calabi-Yau spaces, which are relevant for important questions in 4d quantum gravity concerning e.g. the properties of 4d black holes [10] and the wave function in mini superspace [11].Moreover, while the genus dependence is encoded in the Chern-Simons and matrix model approaches in a superior fashion by the 1 N 2 -expansion, the moduli dependence on the parameter t is reconstructed locally and in a holomorphic limit, typically by sums over partitions. This yields an algorithm, which grows exponentially in the world-sheet degree or the space-time instanton number.As the total F g (t,t) are modular invariant sections over the moduli space M(M), they must be generated by a ring of almost holomorphic modular forms. This solves the dependence on the moduli in the most effective way. In the following we will show that space-time modularity, the holomorphic anomaly equations of Bershadsky, Cecotti, Ooguri and Vafa, as well as boundary conditions at various boundary components of the moduli space, solve the theory very efficiently.For compact (and non-compact) Calabi-Yau spaces mirror symmetry is proven at genus zero. The modular properties that we need are also established at genus zero. Moreover it has been argued recently that the holomorphic anomaly recursions follow from categorical mirror symmetry [8,9]. To establish mirror symmetry at higher genus, one needs merely to prove that the same boundary data fix the F g (t,t) in the A-and the B-model.• Further conditions are provided by the regularity of the F (g) at orbifold points in M(M). These condition...