HNHacker News
TopNewBestAskShowJobs

GregarianChild

425 karma · joined February 23, 2020

submissionscomments
GregarianChild··on JDK 20 G1/Parallel/Serial GC Changes
Agreed!

Regardless of programming language, every substantial software development needs to make serious architectural choices, otherwise things will become messy. I learned this the hard in my first programming job out of university. We were a C/C++ shop doing distributed software and one question to decide right upfront is: shared memory vs message passing. Both have advantages and disadvantages, but don't mix well. We started out with message passing, but over time somebody added POSIX shared memory as a performance hack (which two processes happen to run on the same machine). Over time, we added a second, non-POSIX shared memory layer for performance reasons under Windows. It was an unmaintainable mess. The core problem was that the CTO didn't understand distributed programming well enough to push back against those performance hacks. "How do you handle software architectural leadership?" used to be one of my replies to the inevitable "have you got questions for us?" in job interviews, when I was being interviewed. Now that I am making architectural decisions myself, I put a lot of efforts into this, for example building suitable linters that flag violations in code reviews.

If your team fights over cats vs scalaz or over Scala-as-OO vs Scala-as-FP then that's a sign that the technical / architectural leadership is weak. Choices like pure-OO vs pure-FP vs mixing them require care, and are hard to change in-flight. If you have strong modularisation, you can successfully use different paradigms in different modules, but strong modularisation needs care and architectural discipline, too. Part of the problem is that the style of programming that libraries like cats require (monads, functors, applicative, type-classes, HKTs) is not yet widely understood. This approach to programming needs its 'map/reduce moment' and become part of the mainstream introduction-to-programming curriculum. We'll get there, maybe in about a decade.

GregarianChild··on 10 Years of Scala.js
Thank you Sébastien for your great work. Scala.js is one of the reasons I have been using Scala (for stuff that can be done in garbage collected languages).

What's your roadmap for Scala.js, any major innovations or changes in the pipeline? I have recently migrated a lot of code to Scala 3, and I'm about to begin a new project. So I am wondering if I should plan for interesting innovation in the Scala.js space, or if you are planning to be conservative.

GregarianChild··on Ask HN: How to get a job as a compiler engineer?
I'm a bit surprised by what you write.

Until recently I was heading a compiler team. We found it impossible to hire experienced compiler engineers despite paying very well, so we essentially switched to hiring promising university graduates and trained them on the job. My peers in other companies are all in the same situation.

Note that there is a mismatch between academic and industrial compiler work. A university compilers course is necessary, but not sufficient to be considered experienced, you should have good knowledge of things like ABI design, ELF, DWARF, LLVM's tablegen, C++, compilation of varargs etc. This stuff is not typically taught in compiler courses (for good reason, since it is a bit arbitrary) but it is absolutely vital to producing a working, industrial strength compiler. You should also have some idea about computer architecture, so you can read ISA manuals and understand what individual machine instructions do, and what performance characteristics they have. Otherwise you won't be able to write good instruction selection and scheduling. Given the increasing prevalence of JIT compilers (eg eBPF in the Linux kernel), it's also useful to know about that. Another dimension is security: modern compilers to need to worry about stack canaries, shadow stacks etc. This too is not taught at universities.

Regarding what tool/library/framework, skills are rather transferrable, so I would not worry too much about this. LLVM is by far the most widely used open framework and is easier to get into than other open stuff. If you are knowledgable about security and verification, doing hacking on e.g. CakeML [1] or CompCert [2] might be interesting.

A good way of being hired is to go to e.g. LLVM or GCC meetup, and make it clear that you are looking for a job. Put it on your Github that you are looking for a job. Put a link to an LLVM or GCC (or similar) compiler phase that you have written. The next LLVM dev meeting is November 8-9 in San Jose, CA, hang out there, rest assured there will be many companies seeking to hire. Bonus points if you give a presentation, even if it's whimsy like compiling Brainfuck to Intel 4004 ... Another avenue is RISCV startups which are currently 10-a-penny, they all need and hire compiler engineers. Cold-contact them ...

PS, since you are a PhD student. I suggest finishing your PhD in some form or other. A lot of companies are loath to hire PhD students before they finish, or make the job offer contingent upon successful graduation. That certainly was our policy. If you are not yet near graduation, I suggest to do a compiler related internship.

[1] https://cakeml.org/

[2] https://github.com/AbsInt/CompCert

GregarianChild··on Faked Beta-Amyloid Data. What Does It Mean?
Did he?

From the abstract: "my analysis could not clearly determine whether the bias was caused by misclassifying ambiguous phenotypes or deliberate falsification of the results."

GregarianChild··on TSMC eyes Germany as possible location for first Europe chip plant
Chisel's being hooked into the Java / Scala tool chain give makes setting up automated verification pipelines much easier:

- You can use SBT or MVM to pull in dependencies

- You can wrap up designs as .jar files

- Powerful testing tools like QuickCheck come ready made

None of the above is rocket science, but simply by being there things become easier.

   without knowing anything of the 
   industry, tools,
It's pretty difficult for a student to find out about what is actually used in industry. The semi industry's secrecy doesn't help. But software and hardware people really don't even have a shared language, and misunderstand each other's abilities and pain points. The very term "verification" is understood quite differently between the different communities.
GregarianChild··on The Assange case is collapsing but it remains a travesty of justice
https://en.wikipedia.org/wiki/Celle_Hole

https://magazin.spiegel.de/EpubDelivery/spiegel/pdf/13518912

GregarianChild··on Intel Reportedly Interested in Acquiring RISC-V Firm SiFive
LinkedIn is always interesting, I agree.

For example, what is cloud guy like Larry Wikelius doing at a wireless processor company like Qualcomm?

GregarianChild··on Intel Reportedly Interested in Acquiring RISC-V Firm SiFive
Who says that Qualcomm are not also trying to do something in the RISCV space?
GregarianChild··on Intel Reportedly Offers over $2B to Acquire the Fabless Semiconductor SiFive
See also https://www.phoronix.com/scan.php?page=news_item&px=Intel-In...
GregarianChild··on Intel Reportedly Interested in Acquiring RISC-V Firm SiFive
I imagine that the real reason is not the attractiveness of the ISA, but the commercial danger of NVidia gaining control over Arm IP.
GregarianChild··on Intel and AMD Contemplate Different Replacements for x86 Interrupt Handling
It is true that we currently cannot hide the microarchitectural effects of unsuccessful speculation, as exposed by transient execution attacks like Spectre and cousins.

So what?

Most workloads / customers are much more about performance than security. We can trivially remove such attacks by switching off all speculation (branch prediction, caches, OOO, prefetching). Indeed you can buy CPUs like that, and they are used in environments where safety is of extreme importance. The cost of this is an orders-of-magnitude loss of performance Most workloads (e.g. Netflix streaming, Snapchat filters, online advertising, protein folding, computer games, Instagram, chat apps) are simply not security sensitive enough to care.

Building a competitive general purposes CPU costs a lot (probably > $1Billion end-to-end), and who would buy a CPU that is safe against Spectre but 3 orders of magnitude slower than the competition? (Not to mention that there are many more dangerous vulnerabulities, from Rowhammer to Intel' Management Engine, to rubber hose ...)

GregarianChild··on Intel and AMD Contemplate Different Replacements for x86 Interrupt Handling
I agree with jcranmer and astrange!

It is not possible, in June 2021, to build a compiler that can schedule general workloads as well as an out-of-order scheduler can at run-time in a modern CPU. Note that the scheduling we are talking about is mostly to do with data location in order to hide the latencies of data-movement: In order to hide data movement latencies, you need to know if needed data is in L1, L2, L3, or main memory. In general workloads this is very much data dependent. How is a static, or even JIT, compiler supposed to know with enough precision where data is located at run-time? An additional problem is that compiler scheduling needs bits for encoding scheduling information, which does not come for free: those bits cannot be used for other purposes (e.g. larger immediate arguments). For more specific workloads where data movement is more predictable, i.e. not itself data-dependent, the situation is different, whence the rise of GPUs, TPUs, signal processing cores etc.

Spectre and Meltdown are orthogonal. They come from speculation, e.g. branch prediction. Compile-time branch prediction is similarly infeasible for general workloads.

GregarianChild··on CSIRO's Data61 Dismantles SeL4 Team
What else would you have used as branding?
GregarianChild··on CSIRO's Data61 Dismantles SeL4 Team
I think seL4 is orthogonal to the team's core achievements which are in verification of low-level code. Those technologies transfer to other settings.
GregarianChild··on CSIRO's Data61 Dismantles SeL4 Team

    The SeL4 FAQ has this gem
I'm struggling to say what's wrong with that claim from a scientific POV.

As others also point out, security is conditional on various things, including, in this case, what you consider a valid flow of information and what you don't. For example if an OS allows user-mode to read AES-encrypted kernel-mode data then that would be insecure if you had an unrestricted attacker (who can brute-force AES) but secure assuming polynomial attackers (under standard hardness assumptions for AES). To add insult to injury, we don't in fact know if the standard hardness assumptions actually hold for AES.

GregarianChild··on Are deep neural networks dramatically overfitted? (2019)
In practise, how do you know if SDG has converged to a global optimum, and do you let it run long enough in practise until covergence?
GregarianChild··on Are deep neural networks dramatically overfitted? (2019)
Have you got a reference for the 1989 discovery of double descent? I brief Googling didn't unearth it. I'm not "citation needed"-ing you. I think a lot of decision-tree and boosting work is being rediscovered by the DL community. I would love to see the original discovery.
GregarianChild··on Lion: A formally verified, 5-stage pipeline RISC-V core
There is a lot of resistance to dropping Verilog among working processor designers in my experience. Interestingly, LLHD is being folded into CIRCT [1] which is part of LLVM.

[1] https://github.com/circt

GregarianChild··on Lion: A formally verified, 5-stage pipeline RISC-V core
The RISC-V ecosystem is quite fond of Chisel [1]. A new kid on the block is LLHD [2]. There are numerous others.

[1] https://github.com/lowRISC/chisel

[2] https://llhd.io/

GregarianChild··on Lion: A formally verified, 5-stage pipeline RISC-V core
Yes, so you want to say something like: the CPU doesn't allow additional timing attacks that already exist in software. Making such a relational property formal in a way that is usable in practise is a hard problem.
GregarianChild··on Lion: A formally verified, 5-stage pipeline RISC-V core
How are you planning to ensure that all victim code has data-independent timing?
GregarianChild··on Lion: A formally verified, 5-stage pipeline RISC-V core
That's interesting!

What kind of consistency checks (other than register state being preserved by commands that do not write to the register in question)? Is there some standard best practise?

GregarianChild··on Lion: A formally verified, 5-stage pipeline RISC-V core
That would be great. But isn't there a danger, that such a CPU, at least if implemented naievely, would basically mostly idle, since modern OoO processors schedule memory access dynamically? For hard real-time tasks, some CPUs don't have caches, to make timing more predictable, but there is a heavy performance penalty to be paid for that predictability.

Are you familiar with works like [1]? That is thinking in this direction, but from a different angle.

[1] G. Heiser, G. Klein, T. Murray, Can We Prove Time Protection?. https://arxiv.org/pdf/1901.08338.pdf

GregarianChild··on Lion: A formally verified, 5-stage pipeline RISC-V core
This is a good middle ground, but ...

... leakage by timing side-channels depends in parts on how accurate your time-measurements are (e.g. Javascript's timer resolution was degraded, in order to make transient failure attacks like Spectre harder [1]).

I totally agree with your second point and believe, but cannot prove, that no current processor with any competitive performance is free from timing side-channels, the best we can currently do is put upper bounds on leakage rate. There are just so many other timing side channels, e.g. port contention [2]. They just keep popping up ...

Another dimension is the very meaning of thread. Presumably, as an end-user, you care about the threads/processes that the operating systems defines. But they don't map one-to-one to hardware threads, cores etc. Indeed I would argue that processors don't have threads in the sense that end-users care about. So the relevant security property must be regarding a hardware/software interface. Quite how to nail down this isolation property is active research I think. See e.g. [3] for work from 2016 in this direction.

Yet another dimension to this is through passwords and similar mechanisms: presumably you want to allow doing things like "sudo" so a low-priority thread can increase priority, provided the former knows the right password. But the very act of supplying a false password, leaks a tiny bit of information (that can be quantified in terms of Shannon-style information theory) about the password's search space.

[1] https://hackaday.com/2018/01/06/lowering-javascript-timer-re...

[2] A. Bhattacharyya, A. Sandulescu, M. Neugschwandtner, A. Sorniotti, B. Falsafi, M. Payer, A. Kurmus, SMoTherSpectre: Exploiting Speculative Execution through Port Contention. https://arxiv.org/abs/1903.01843

[3] D. Costanzo, Z. Shao, R. Gu, End-to-end verification of information flow security for C and assembly programs. https://6826.csail.mit.edu/2019/papers/certikos-sec.pdf

GregarianChild··on Lion: A formally verified, 5-stage pipeline RISC-V core
I'm a bit reluctant to reply without having looked at the article in detail, but I feel confident that the answer must be negative!

Why?

Because the very concept of side-channel depends on attacker capability! For example, does your attacker have physical access to the processor or not? With physical access you can exploit channels like power consumption through differential power analysis, or shoot laser pulses at target transistors to flip them and induce the processor to leak secrets. OTOH, without physical access, those channels don't meaningfully exist and you need to rely on, for example, speculation failure attacks and exfiltration via cache timing. So what counts as a side-channel is attacker-capability dependent.

GregarianChild··on Native Type Theory
It's hard to predict the future.

Alan Turing invented neural nets in a little-known paper entitled Intelligent Machinery (see [1]), in 1948. Since, the use of NNs has moved away decisively from inspiration by nature. I reckon, nature's last big win in AI were convolutional NNs: Kunihiko Fukushima's neocognitron was published in 1980, and inspired by 1950s work of Hubel and Wiesel [2]. Modern deep learning is largely an exercise in distributed systems: how can you feed stacks and stacks of tensor-cores and TPUs with floating point numbers, while minimising data movement (the real bottleneck of all computing)?

Not unlike, I think, how airplanes were originally inspired by birds, but nowadays the two have mostly parted ways, for solid technical reasons.

[1] http://www.alanturing.net/turing_archive/pages/Reference%20A...

[2] https://en.wikipedia.org/wiki/Neocognitron

GregarianChild··on Native Type Theory
In ZFC, you define reals as you sketch, and then specify rationals, integers etc as specific subsets, then you get inclusions, which mainstream mathematics uses without worries. And yes, mainstream mathematics is non-constructive (as is Isabelle/HOL).

(I don't want to have a contentious discussion about FOMs, or which prover is best, just trying to sketch the trade-offs, and historical background.)

GregarianChild··on Native Type Theory
This 'baggage' are statements like

   sqrt(17) ∈ log(.)
(where (log(.) is the logarithm function) which are syntactically valid and have a truth value, which depends on the exact nature of how you code up various mathematical things in ZF(C). Your cannot form such propositions in type-theory. The downside of type-theory is that it seems difficult to have simple inclusions like:

   Naturals ⊆ Integers ⊆ Rational ⊆ Reals
and that certain natural operations (like quotients) seemingly are labourious in type-theory.
GregarianChild··on Native Type Theory
The issue is automation: At this point (Feb 2021), the support in interactive theorem provers is just much better for type-theory based mathematics in contrast to set-theory based maths. Whether that is due to technical advantages of type-theory over set theory, or a historical accident, reflecting the much larger amount of attention on type-theory as basis for interactive provers, is a subject of much controversy. Let me cite a leading light in the formalisation of mathematics [1]: "I would guess that the amount of effort and funding going into type theory exceeds the amount that went into set theory by an order of magnitude if not two [...] I am certain that we would now have highly usable and flexible proof assistants based on some form of axiomatic set theory if this objective had enjoyed half the effort that has gone into type theory-based systems in the past 25 years."

Paper [2] has brought renewed attention to set-theory as a basis for automating mathematics.

[1] https://cs.nyu.edu/pipermail/fom/2018-June/021032.html

[2] https://arxiv.org/abs/1707.04757

GregarianChild··on Native Type Theory
The MathInspector is nice. Reminds me of the "Incredible Proof Machine" [1] which I find to be a neat tool in teaching logic.

[1] https://incredible.pm/

← PreviousPage 3 of 6Next →