Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
nlewycky
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
nlewycky
1y ago
Gecode won the minizinc challenges from inception of the challenge in 2008 until 2012, but these days or-tools wins gold every year 2013 to 2024, and in 2024 swept gold in all categories. Why is gecode interesting? Why use it over or-tools?
2.
▲
by
nlewycky
2y ago
Set e-graphs apart from e-matchers. An e-graph is a vector-of-sets, where each set contains equal representations of the same thing. What makes it space efficient is that your representation refers to things by index number in the vector, s
3.
▲
by
nlewycky
2y ago
> I was bitten by one that injected timing attacks into certain integer operations by branching on the integer data in order to optimize 32-bit multiplications on 8-bit microcontrollers. FWIW, I think this should be considered a language
4.
▲
by
nlewycky
2y ago
> No, literally nobody has ever wanted to be directed to "foundem", which is a scam. Could you defend the statement that "foundem" is a scam? If it really was then that adds important context to the ruling, but I'
5.
▲
by
nlewycky
2y ago
2020 was one outlier data point caused by COVID?
6.
▲
by
nlewycky
2y ago
> > the epilogue is only correct if the function has void return type > That's a lie. All C functions return via a return statement with expression (only for non-void functions), a return statement without an expression (only
7.
▲
by
nlewycky
2y ago
I'm a huge proponent of UBSan and ASan. Genuine curiosity, what don't you like about them? FWIW, there once was a real good-faith effort to clean up the problems, Friendly C by Prof Regehr, https://blog.regehr.org/
8.
▲
by
nlewycky
2y ago
This is the most normal case though, isn't it? Suppose a very simple compiler, one that sees a function so it writes out the prologue, it sees the switch so it writes out the jump tables, it sees each return statement so it writes out
9.
▲
by
nlewycky
2y ago
This construction is called a "false range" in English. https://www.chicagomanualofstyle.org/qanda/data/faq/topics/C... https://www.cjr.org/language_corner/out_of_range
10.
▲
by
nlewycky
2y ago
Why isn't that fine? The compiler ignored the undefined behavior it didn't detect.
11.
▲
by
nlewycky
2y ago
> The continuity of physical processes is not something that can be proved. I agree with you, but is there any peer-reviewed publication that can be cited? The idea makes sense to me, firstly the Reals \ Inaccessible Reals = Computable R
12.
▲
by
nlewycky
2y ago
From the abstract, "simulations of such systems are usually done on digital computers, which are able to compute with finite sequences of rational numbers only." Not at all! Digital computers can use computable reals which are def
13.
▲
by
nlewycky
2y ago
The compiler may remove the nullptr check in: ptr->foo = 1; if (ptr == nullptr) return; but it may not remove the nullptr check in: if (ptr == nullptr) return; ptr->foo = 1;
14.
▲
by
nlewycky
2y ago
> If the print blocks indefinitely then that division will never execute, and GCC must compile a binary that behaves correctly in that case. Is `printf` allowed to loop infinitely? Its behaviour is defined in the language standard and GC
15.
▲
by
nlewycky
2y ago
> You're right, most times organizations need a fire lit underneath them to change, for Google, it probably was the NSA annotation "SSL added and removed here :^)" on a slide showing Google's architecture from the Sno
16.
▲
by
nlewycky
3y ago
The symptoms match my experience with a mid-network firewall/router that is not aware of TCP window scaling stripping out the scaling factor while leaving the window scaling feature enabled. See https://lwn.net/Articles
17.
▲
by
nlewycky
3y ago
It caused a problem when building inline assembly heavy code that tried to use all the registers, frame pointer register included.
18.
▲
by
nlewycky
3y ago
> If I put in a dereference, I expect a dereference to happen. Not dereferencing the pointer when I wrote a dereference operator seems like going too far. Surely not? I mean, you probably didn't intend to include unevaluated context
19.
▲
by
nlewycky
3y ago
The hard part of UB isn't where it's mentioned in the standard. The problem is when the standard says "in case A, X occurs, in case B, Y occurs" then somebody invents a situation where neither A nor B apply.
20.
▲
by
nlewycky
3y ago
> Deleting code that isn’t dead, it just doesn’t have a universally defined behavior, is the issue. Can I delete "if (x & 3 == 16)" without a warning? There is no 'x' which makes that expression true, so I can saf
21.
▲
by
nlewycky
3y ago
> I've forgotten if 'address of' ( & ) is signed or unsigned. Neither, pointers are their own types which have no sign, only integral types come in signed and unsigned. There exist intptr_t (signed) and uintptr_t (unsi
22.
▲
by
nlewycky
3y ago
I can offer you -fsanitize=undefined -fsanitize-trap=undefined, which you'd need to put in your configuration for release builds, presumably you have other flags in your build system (like -O2) already. It's possible that a progra
23.
▲
by
nlewycky
3y ago
> -Wub # Warn _anytime_ there is detected potential undefined behavior, irrespective of if there is an associated optimization. Can I ask you, have you tried any existing tools? Coverity static analysis, Klocwork, PVS-Studio, clang stati
24.
▲
by
nlewycky
3y ago
Dead code happens all the time. Adjusting the example in my comment you're replying to: vector<t> v; v.push_back(a); v.push_back(b); v.push_back(c); v.push_back(d); Let's suppose the definition of ou
25.
▲
by
nlewycky
3y ago
bool overflowed = (x+1)<x; I was convinced that some warning, probably -Wtautological-compare, already handled this and I plugged it into godbolt to see which one, but got no warnings with either gcc or clang. Frankly, I'm
26.
▲
by
nlewycky
3y ago
Hi! I'm a former compiler engineer who specialized on undefined behaviour. Would you like warnings on: * int f(int x, int y) { return x + y; } * int get_x_coord(Point *p) { return p->x; } * void compute_and_cache(const ch
27.
▲
by
nlewycky
3y ago
> - “p” - a category of problems which can be solved in O(n²) > - “np” - a category of problems which can be checked, but not solved, in O(n²) These definitions are incorrect. Certainly there are other polynomials than just n². P is t
28.
▲
by
nlewycky
3y ago
Not mentioned in this doc, I like using `-fsanitize=safe-stack` in release builds. Accesses to stack allocated arrays which have non-safe offsets (compiler fails to prove all accesses are in bounds) cause the object to be allocated on the u
29.
▲
by
nlewycky
3y ago
> Things like mutating a vtable could be fair game, just do it carefully. However that's not the setup. You can mutate a vtable without UB. A method may call the destructor on its this pointer and use placement-new to create a new o
30.
▲
by
nlewycky
3y ago
> However, this is impossible as per Rice's theorem. You moved a _little_ too quickly. There exist program-pairs which can be proven equal, and those for whom no proof exists. You can organize the production of new programs into fin
More ›