@cfbolz@mastodon.social
@cfbolz@mastodon.social avatar

cfbolz

@cfbolz@mastodon.social

PyPy/RPython contributor. Half time teaching at Uni Düsseldorf. Works on dynamic language implementations. Vegan. Love street art and art in public spaces, hiking, reading.
they/them/?

This profile is from a federated server and may be incomplete. Browse more on the original instance.

cfbolz, to random
@cfbolz@mastodon.social avatar

Anyone now what the least bad option is to express popcount of a bitvector in Z3 is? @regehr maybe? (I tried both a naive loop as well as a bit-twiddling advanced solution. the latter worked but was on the slow side, and the loop blows up all my timeouts)

cfbolz,
@cfbolz@mastodon.social avatar

@regehr right, that's kind of what I tried but it took ages. now I'm doing the fancy bit-twiddling thing and it's faster.

(sidenote: this is the fun trick I realized this week. you can pass z3 variables to python code that does straightline bit-manipulation and it will work just fine, due to dynamic typing and operator overloading. the popcount in the screenshot works both for python ints but also happily spits out a Z3 formula)

cfbolz,
@cfbolz@mastodon.social avatar

@pervognsen @regehr yeah, ifs are a problem. It's doable with some tricks maybe, I'm still thinking about it

pervognsen, (edited ) to random
@pervognsen@mastodon.social avatar

This is my 30 years belated realization that PHIGS was a 'graphics' pun pretending to be an acronym. I'm not sure if that makes me hate it more or less. I'm leaning towards more. The focus on PHIGS was less welcome when I read Foley and Van Dam than the chapter on dot-matrix printing which at least had some timeless "how stuff worked" appeal. Teaching specific APIs in a textbook almost never ages well.

cfbolz,
@cfbolz@mastodon.social avatar

@pervognsen heh, I read 'GC textbooks' first and was a bit confused for a second

hugovk, to python
@hugovk@mastodon.social avatar

📣🐍📚 Calling all Python library maintainers!

Python 3.13 is now in beta, with the second of four beta releases out later today!

It's now time to start testing your libraries with 3.13 and report any problems back to CPython so they can be fixed before the big October release. And make any updates you need to upgrade your library; keep an eye out for removals and deprecations.

Here's how to test 3.13 on GitHub Actions:

https://dev.to/hugovk/help-test-python-313-14j1

#Python #Python313 #beta #GitHubActions

cfbolz,
@cfbolz@mastodon.social avatar

@hynek @hugovk I think it's mainly undermaintained (just like everything else) :-(

cfbolz, to random
@cfbolz@mastodon.social avatar

Decided to ask for my CPython commit bit to be reinstated (I used to have it in mercurial times, but didn't follow the switch to github)

villares, to python
@villares@ciberlandia.pt avatar
cfbolz,
@cfbolz@mastodon.social avatar

@villares @melissawm great post, thanks for the link! I also thought footnote 3 was quite interesting:

cfbolz, to random
@cfbolz@mastodon.social avatar

The website of the "Decompiler Explorer" is https://dogbolt.org 😆

cfbolz, to random
@cfbolz@mastodon.social avatar

This weekend I landed a CPython PR that I'm very happy about (with the help of @ambv and Dennis Sweeney):

I switched the storage of all the names of Unicode code points in the unicodedata modules to using a different data structure, a "directed acyclic word graph". This makes the compiled module 440 KiB smaller. I did the same thing in PyPy a year ago, quite happy that it now made it to CPython too.

https://github.com/cfbolz/cpython/commit/9573d142157d8432f2772a109c304dafeaa454a5#diff-372ed45e01f260ef615543328bba7a8af29b0ded4e8b1f4142be55bd75ed54bf

cfbolz, to random
@cfbolz@mastodon.social avatar

Well dressed older guy at the main station casually chatting on his Motorola Razr, unbothered by all the Discourse

cfbolz, to random
@cfbolz@mastodon.social avatar

two weeks with a broken dishwasher makes me appreciate having it a lot more

cfbolz, to random
@cfbolz@mastodon.social avatar

Look, someone clicked 'inspect element' on the street!

cfbolz, to random
@cfbolz@mastodon.social avatar

I'm happy to report that I'm not the only one who is thinking way too hard about how to efficiently store all the unicode character data in memory 😅😅😅: https://gist.github.com/js-choi/320275d05d6f252f6bd55199f76489a6

cfbolz, to random
@cfbolz@mastodon.social avatar
adamchainz, to python
@adamchainz@fosstodon.org avatar

🐍♦️ Use Git to pass pytest a list of all modified test files:

pytest $(git diff --name-only '/test_.py')

Adjust the pathspec (Git’s “glob” syntax) if you have a different test file naming convention.

#Python #Git

cfbolz,
@cfbolz@mastodon.social avatar

@adamchainz I've wanted a way to do this on the individual test function level for a long time. Something like --ff but 'run changed/new tests first'

cfbolz, to random
@cfbolz@mastodon.social avatar

"Fixing a Bug in PyPy's Incremental GC", the promised blog post on my recent debugging Odyssey:
https://www.pypy.org/posts/2024/03/fixing-bug-incremental-gc.html

cfbolz, to random
@cfbolz@mastodon.social avatar

I just merged the PyPy "known bits" JIT optimization that Nico Rittinghaus and I worked on in the last two years. It allows the JIT to reason about specific bits of integer variables that are known to be 0 or 1. This makes bit-manipulation code faster, sometimes significantly so.

A concrete example of something the JIT now knows, but didn't before: if you add two even integers together, you get an even result.

cfbolz,
@cfbolz@mastodon.social avatar

Code that does a lot of bit twiddling (eg bitwise and, or, xor, shifts, etc) is not so common in Python, so this does not really help on "normal" Python benchmarks and code.

However, it helps Pydrofoil a lot, our sibling project that uses the RPython JIT to generate jitted full-system emulators for RISC-V and ARM:

https://docs.pydrofoil.org/en/latest/

e.g. booting Linux on Pydrofoil-ARM becomes 30% faster.

cfbolz, to random
@cfbolz@mastodon.social avatar

I just learned that there are floating point numbers that have non-unique (positive) square roots:

>>>> s = {4.472135954999575e-155, 4.472135954999576e-155, 4.472135954999577e-155, 4.472135954999578e-155, 4.472135954999579e-155, 4.4721359549995795e-155, 4.47213595499958e-155}
>>>> len(s)
7
>>>> {x * x for x in s}
{2e-309}

(I suppose it's obvious in hindsight, but I still didn't expect it somehow)

cfbolz, to random
@cfbolz@mastodon.social avatar

I think I complain about this every year, but the end of daylight saving time in fall really sucks. The kids got up at 3:50 this morning (usually it's between 5-6am, which I already find really hard to deal with) 😴😴😴😴😴.

cfbolz, to random
@cfbolz@mastodon.social avatar
cfbolz, to random
@cfbolz@mastodon.social avatar

Im not really posting about it much (or in general it seems) but I'm doing another summer project involving CPU emulators generated from Sail ISA specifications.

Last year I started Pydrofoil and managed to get to the point where my RISC-V emulator could boot Linux.

This year I've been working on pushing the tech the point where I can almost do the same for ARM64:
https://docs.pydrofoil.org/en/latest/arm.html

cfbolz, to random
@cfbolz@mastodon.social avatar

just came up with this amazing python assignment:

() = data

was a bit surprised that it actually works, but well... 😅

(it's a sequence unpacking assignment, where the target sequence has length 0. so essentially an assert that 'data' is bound to a sequence of length 0)

cfbolz, to random
@cfbolz@mastodon.social avatar

we're all stakeholders but some stakeholders are stakeholdier than others

cfbolz, to random
@cfbolz@mastodon.social avatar

I suppose it's better than the usual news

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • kavyap
  • DreamBathrooms
  • cisconetworking
  • khanakhh
  • mdbf
  • magazineikmin
  • modclub
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • Durango
  • tacticalgear
  • JUstTest
  • ngwrru68w68
  • everett
  • normalnudes
  • cubers
  • tester
  • thenastyranch
  • osvaldo12
  • GTA5RPClips
  • ethstaker
  • megavids
  • anitta
  • Leos
  • lostlight
  • All magazines