restart python 3.14 migration due bytecode invalidation in rc3#7795
restart python 3.14 migration due bytecode invalidation in rc3#7795h-vetinari wants to merge 1 commit intoconda-forge:mainfrom
Conversation
| Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
| I wonder if we should wait a few weeks and simply migrate again when 314 is released? Reissuing all of these PRs is a lot of work for everyone and clearly the release candidates are not stable enough for us to use in this way. I don't think we can migrate early in the future if we are going to encounter these large rebuilds. |
I don't think it's so black and white. The current process worked fine for 3.12 and 3.13. The bump of the magic number this late is annoying, but since it's due to a crash, ultimately understandable. But I can bring this concern to the python discourse, that these bytecode invalidations have a big cost for us, and should be avoided in the rc phase. |
FWIW, I'm against this. I think we should restart the current migration ASAP and then keep going as usual. There are no further rc's forthcoming. |
| I don't think the fact that there are no more RCs means for sure we wouldn't have to rebuild again for the first release due to some other bug. However, go ahead if you feel strongly. |
That is always true on a theoretical level, but in practice, the CPython people are aware of the cost, which is why they promise no ABI breaks (for example), and why we believe them. It's in everyone's interest for this social agreement to be respected (where no other concerns exist that have even higher cost). But I'll definitely bring up the argument with the CPython folks that increasing the magic bytecode number almost has the same effect on conda-forge as an ABI break (i.e. requiring a complete rebuild, resp. restart of any ongoing migration). |
| I don’t really see this regression as bad enough to restart the migration. Noarch python also suffer from this regression. It sucks, but bytecode compilation right? |
| As soon as conda-forge/python-feedstock#814 is merged (or if we add artefact persistence to that PR), we could do some timing tests of python 3.14.0 rc2 vs rc3, in an environment full of builds against the old magic number. It's always helpful to have some concrete metrics for decision-making. Perhaps I'm way off, but my intuition is that for larger environments (of packages that are all being actually imported in the code under test), we're talking about potentially several minutes or longer being added to the first start up. If we're in that ballpark, I don't think that'd be an acceptable regression TBH, made worse by the fact that a lot of rarely-rebuilt feedstocks will keep that regression for a long time. PS. I commented in the discourse thread I linked in the OP, discussion is ongoing (basically: this shouldn't happen so late, but not doing it was considered worse). |
I'm slightly positive towards merging this PR before the final release, but would like to see the numbers first as this PR comes at great cost and thus should really be based on strong numbers. Also: |
| I did created a little script to exercise the loading of bytecode by importing stuff |
| I think you can test on a "production" environment of yours: For me (linux 64 bit, modern processor, SATA SSD) Its not so much that I don't like speedup, just given it is "limited" in use, AND that packages naturally get rebuilt, it should be of "limited" value given the added churn. |
| Closing as not worth the hassle, given how comparatively minor the performance number indicate this to be. |
I dislike bumping
migration_number:s, because it makes the mechanics of "when/how does this migrator apply" much less obvious for maintainers.However, in this case I think our hands are tied. Python packages have compiled bytecode (
.pycfiles) which contain a magic number that determines whether they're consumable for a given runtime. In 3.14.0rc3 this magic number was bumped again (after we had already waited for rc2 because that also bumped it).This doesn't break the existing artefacts, but it invalidates their bytecode, meaning any user of py314 that downloads one of the packages with the old magic number will have to wait while a bunch of code gets recompiled, which will be quite visible as a regression of start-up time in a new environment.
Since we're expressly publishing builds intended to be compatible with 3.14 GA already, the only way to ensure that we have a clean set of packages is to rebuild everything. This is painful now, but will only get more painful in the future, so let's bite the bullet sooner rather than later.
Draft until conda-forge/python-feedstock#814 is in.
CC @conda-forge/core