Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hauntsaninja
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
hauntsaninja
6mo ago
I don't yet know a better way to do this than using a threshold! I think if you assume perf is normally distributed, you can still get some of the math to work out. But I will need to think more about this... if I ever choose this adve
2.
▲
by
hauntsaninja
6mo ago
Note that "pick the commit with best expected information gain" in git_bayesect isn't optimal even in the no overhead regime. I provide a counterexample in the writeup, which implies ajb's heuristic is also not optimal.
3.
▲
by
hauntsaninja
6mo ago
Yep, you can run bayesect to an arbitrary confidence level. This script in the repo https://github.com/hauntsaninja/git_bayesect/blob/main/scrip... will show you that a) the confidence level is calibrate
4.
▲
by
hauntsaninja
6mo ago
That sounds right. `git_bayesect` currently uses `--first-parent`, so I think belden's use case should work, but I haven't tested it much on complicated git histories.
5.
▲
by
hauntsaninja
6mo ago
Yes! It will show you the posterior probability as a single commit starts to become more likely. In addition, running `git bayesect status` will show you all posterior probabilities
6.
▲
by
hauntsaninja
6mo ago
Yay, I had fun with it too! IIUC the way you'd do that right now is just repeatedly recording the individual observations on a single commit, which effectively gives it a probability + the number of trials to do the Beta update. I don&
7.
▲
by
hauntsaninja
6mo ago
git bisect works great for tracking down regressions, but relies on the bug presenting deterministically. But what if the bug is non-deterministic? Or worse, your behaviour was always non-deterministic, but something has changed, e.g. your
8.
▲
Show HN: Git bayesect – Bayesian Git bisection for non-deterministic bugs
(github.com)
337 points
by
hauntsaninja
6mo ago
|
43 comments
9.
▲
by
hauntsaninja
8mo ago
Reasoning effort is denominated in tokens, not time, so no difference beyond slowness at heavy load (I work at OpenAI)
10.
▲
by
hauntsaninja
9mo ago
Yes, uv skipping this step is a one time significant hit to start up time. E.g. if you're building a Dockerfile I'd recommend setting `--compile-bytecode` / `UV_COMPILE_BYTECODE`
11.
▲
by
hauntsaninja
10mo ago
Unknown has the exact same type system semantics as Any. Unknown is a pyright specific term for inferred Any that is used as the basis for enabling additional diagnostics prohibiting gradual typing. Notably, this is quite different from Typ
12.
▲
by
hauntsaninja
10mo ago
I’ve added ecosystem regression checks to every Python type checker and typeshed via https://github.com/hauntsaninja/mypy_primer . This helped a tonne with preventing unintended or overly burdensome regressions in mypy,
13.
▲
by
hauntsaninja
10mo ago
The conformance test suite is currently mostly focused on “what does an explicit type annotation mean” A shared spec for this is important because if you write a Python library, you don’t want to have to write a different set of types for e
14.
▲
by
hauntsaninja
10mo ago
Mentioned this in another comment, but the spec conformance suite is not representative of the things users care about (nor is it meant to be). The spec mostly concerns itself with the semantics of annotations, not diagnostics or inference.
15.
▲
by
hauntsaninja
10mo ago
Note: while spec conformance is important, I don't recommend using it as the basis for choosing a type checker. It is not representative of the things that most users actually care about (and is not meant to be). (I was on the Python T
16.
▲
by
hauntsaninja
1y ago
pyright will accept this. mypy should accept this when using --allow-redefinition-new as well
17.
▲
by
hauntsaninja
1y ago
text-davinci-001 is just not GPT-3 in any real sense (I work at OpenAI, I helped build this page and helped train text-davinci-001)
18.
▲
by
hauntsaninja
1y ago
Note that `uvx mypy` may give you inaccurate timings on macOS. The antivirus in macOS goes a little crazy the first time it executes a mypyc compiled program.
19.
▲
by
hauntsaninja
2y ago
We had so many of these issues that we ended up LD_PRELOAD-ing patch getenv / setenv / putenv
20.
▲
by
hauntsaninja
2y ago
Yeah, that's not exactly the problematic situation... but the good news is I improved the Python's error message for this in 3.13. See https://docs.python.org/3/whatsnew/3.13.html#improved-error-...
21.
▲
by
hauntsaninja
2y ago
You don't need to use pytz, you can use the following on all Python 3: tz_UTC = datetime.timezone.utc
22.
▲
by
hauntsaninja
3y ago
Lean heavier on a mypy config file. Make heavy use of per-module configuration, in particular, setting per-module ignore_errors = true for modules you’re not yet ready to type check. See https://mypy.readthedocs.io/en/s
23.
▲
Crashing CPython with Recursion
(hauntsaninja.github.io)
3 points
by
hauntsaninja
4y ago
|
0 comments
24.
▲
by
hauntsaninja
4y ago
In Python 3.11, you can use the "-P" flag or the "PYTHONSAFEPATH" environment variable to avoid adding cwd to sys.path https://docs.python.org/3.11/whatsnew/3.11.html#summary-rele...
25.
▲
by
hauntsaninja
4y ago
You can use numpy just fine. Unlike Cython, mypyc doesn’t give you a way of accessing numpy’s C API (because you’re basically just writing Python code).
26.
▲
by
hauntsaninja
4y ago
mypy compiles itself with mypyc, for about a 3.5-4x speed up. black very recently started shipping mypyc compiled binaries, for about a 2x speed up (iirc).
27.
▲
by
hauntsaninja
4y ago
mypyc has escape hatches, e.g. casting to Any is a common trick.
28.
▲
by
hauntsaninja
5y ago
I wrote a similar tool a while back. My solution for this was to statically analyse the input to discover unused names. The cool part of doing transformations statically is that you're able to see the exact Python code you'd run w
29.
▲
by
hauntsaninja
5y ago
I wrote a similar tool a while back that lets you create your own "magic" variables. I use `f` all the time! https://github.com/hauntsaninja/pyp#pyp-lets-you-configure-y...
30.
▲
by
hauntsaninja
6y ago
Python's static type system can express what you describe using TypeVars or overloads. The issue is that `int pow(int, int)` is fundamentally incorrect. If the exponent is a negative integer, the return type would need to be float. As
More ›