  We demonstrate how to construct GR-independent equations of state. We
emphasize the importance of using theory-based principles instead of relying
solely on astrophysical observables and General Relativity (GR). We build a set
of equations of state based on first principles, including chiral perturbation
theory and perturbation theory in quantum chromodynamics. Interpolation methods
are employed to assume thermodynamic stability and causality in the
intermediate region. These equations of state are then used to constrain
quadratic Palatini $f(\mathcal R)$ gravity, indicating that the parameter lies
within the range $-6.47 \lesssim \beta \lesssim 1.99$ km$^2$. Additionally, we
briefly discuss the problem of phase transitions and twin stars.
