opentensor / bittensor

Internet-scale Neural Networks
https://www.bittensor.com/
MIT License
851 stars 301 forks source link

bitensor version as int supports only minor,patch versions <10 #1982

Closed mjurbanski-reef closed 2 months ago

mjurbanski-reef commented 2 months ago

Describe the bug

https://github.com/opentensor/bittensor/blob/master/bittensor/__init__.py#L33C1-L37

If bittensor 7.10.1 gets released, it will get encoded as version 801, and break version comparisons.

While releasing 100 of patch releases maybe far fetched (but not impossible), the release of 10+ minor version is quite common (e.g. Python is currently at 3.13 ).

To Reproduce

-

Expected behavior

I would expect bittensor.__version_as_int__ to be always > than previous version, even if we have more than 10 releases.

A possible solution would be to use *100 multiplier - after all if we used *10 we would still require uint32. This would be also backwards compatible change - > comparison between new released version and old one would still give the expected results.

Screenshots

No response

Environment

-

Additional context

subtensor seems to encode bittensor/subnet version as u32 int, so we have plenty of room there

mjurbanski-reef commented 2 months ago

Please note this already happened, I.e.

Current 7.0.1 release is encoded as 701, while 6.12.2 was encoded as 722.

$ pip install bittensor==6.12.2
$ python -c 'import bittensor; print(bittensor.__version_as_int__)'  2> /dev/null
722