Sensitive polarimetry in X-rays has the potential to probe the geometry and physics of astronomical compact sources - neutron stars and black holes - to a level often impossible even for the best current and future X-ray imaging and spectroscopic observatories. In particular, X-ray polarimetric measurements will provide an unprecedented opportunity to gain insight into the physical processes in ultra-magnetized neutron stars, including testing QED vacuum birefringence, and to probe the geometry and nature of hot coronae around black hole accretion discs, where General Relativity is at work in the strong-field regime. Over the last decade, several X-ray polarimetric missions have been proposed, culminating in the launch of the IXPE satellite in December 2021. The members of our team contributed to IXPE development, construction and data analysis at all levels, and are deeply involved in the eXTP and GoSOX missions. Our project gathered at best the opportunities X-ray polarimetry offers to foster our understanding of neutron stars and black holes. The focus of the proposed research was both on the theoretical and the instrumental/observational sides. The Padova and Roma Tre units built detailed models for the polarization properties of radiation from highly magnetized neutron stars and black hole accretion discs. Each unit took advantage of the other unit expertise in numerical radiative transfer calculations under extreme physical conditions. Strong interactions between the Padova and Roma Tre units on one side, and the INAF unit were successfully carried out. The extensive expertise of the INAF team on the measurement X-ray polarization from astronomical sources allowed to evaluate the observability of the simulated effects and directed our efforts along the most promising avenues. The scientific outcome of the project will also be a driver for next-generation polarimetric missions in which our team has a leading role. Our project extended over the entire phase-1 of IXPE operations and the subsequent General Observer program, covering the developing phase of the polarimetric missions currently in the study phase. Its results will be instrumental in refining the design and the target selection of future missions.