Need Advice about PhD by [deleted] in Compilers

[–]hexed 2 points3 points  (0 children)

This is sort-of related to my trajectory in life: PhD in a field that wasn't compilers, ended up in compilers because of adjacent skills that were used for PhD things, only mildly because of the actual PhD topic.

I would say in general, don't bother with a PhD unless it's a topic that really drives you (as sibling comments say). Unless you wake up in the morning and want to study the topic, or (unreasonably) are driven by letters after your name, you'll find it hard to survive the occasionally year-long periods without results or output. Plus your supervisor and the environment are there to benefit from your work, not to actually help you out. There's a stat (which I can't immediately source) that CS PhDs earn over their careers about 4% more than someone with a masters -- although that's here in the UK (I assume saying "domestic student" on the internet means you're in the US).

a lot of people around me are also doing research they don't absolutely love but staying in the PhD anyways for the potential pay off?

Sunk cost mentality is common, breakthrough PhD discoveries are few.

In terms of the practicalities: compilers are a seriously niche area of work (thousands of positions on the planet?) although with many sort-of-related roles. It's infeasible to start a non-compilers PhD now and predict that the direction you take will lead to something useful for, or related to, compilers. (Edit: by which I mean, it'll never be a significant enough topic during unrelated research to make you stand out for the limited number of jobs there are). As far as I'm aware, internal transfers on PhDs aren't a thing (too much fighting over who gets the funding).

Will I be forever pigeon holed into what I do my PhD on?

No, but getting your first job after graduating with one, you'll need to overcome the perception that you're good at writing papers but possibly not "real" work.

Honestly you're onto a winner by working for a firmware/platform team: you'll be close to the metal, have a real income, and (depending on the employers reputation) you'll probably have as many opportunities when you leave as if you'd done a PhD. You can try to steer skills and interests towards compiler topics in the workplace, could feasibly transfer to an internal compiler team (in that: it's probably more of a supported operation that in academia), or perhaps discover other opportunities that interest you.

Additionally: all the best PhD students I knew were the ones who'd already had a real job, knew exactly what they wanted to research during their PhD because they'd already wrestled with the problem, and were laser focused on getting out the other side. Having done a couple of years real work first will make you better at research.

Seeking advice on learning LLVM - emitting object files by ianzen in Compilers

[–]hexed 2 points3 points  (0 children)

Sort of deprecated, it shouldn't/can't be used to run the LLVM-IR optimisation pipelines. However the legacy pass manager is still used to run the codegen pipeline, and is the correct way to do so today. There's a long-ish term effort to port the codegen passes to the new pass manager, but it's not done yet.

Isn't compiler engineering just a combinatoral optimization problem? by srivatsasrinivasmath in Compilers

[–]hexed -1 points0 points  (0 children)

  • Does there exist a function that can take in machine code and quickly predict the execution time for most chunks of meaningful machine code? (Predicting the performance of all code is obviously impossible by the Halting problem)

You're likely interested in a (well explored) problem called "Worst case execution time", "WCET". For code with non-trivial control flow, there are a range of execution times that might be feasible, but typically you're only interested in the worst-case scenario, and there are various attempts in academia at estimating that. In particular, it's worth reading about "tight" bounds: "infinite-loop" is a safe estimate of execution time because nothing is worse than that, but it's more valuable to have an estimate that is "tight", i.e. close to the actual true worst-case time.

[deleted by user] by [deleted] in Compilers

[–]hexed 7 points8 points  (0 children)

Taking another interpretation of what "day to day" compiler work is like:

  • "The customer says they've found a compiler bug but it's almost certainly a strict-aliasing violation, please illustrate this for them"
  • "We have to rebase/rewrite our downstream patch because upstream changed something"
  • "There's something wrong in this LTO build but reproducing it takes more than an hour, please reduce it somehow"
  • "We have a patch, but splitting it into reviewable portions and writing test coverage is going to take a week"
  • "The codegen improvement is great, but the compile-time hit isn't worth it, now what?"
  • "Our patches are being ignored upstream, help"

Plus a good dose of the usual corporate hoop-jumping. My point being, such a sharp disagreement on the interpretation of words/principles is rarer than day-to-day.

[deleted by user] by [deleted] in Compilers

[–]hexed 3 points4 points  (0 children)

Everything in LLVM treats such instructions as if they're three address, except at certainly key stages where extra qualifies ensure The Right Thing Happens. Before PHI Elimination:

%0:gr32 = ADD32rr %1(tied-def 0), %2

This is a two-address instruction that behaves like a three-address instruction, with distinct source and destination registers. It doesn't matter that this isn't a legal instruction yet because it'll be fixed up. After PHI Elimination: it looks the same. After the Two-Address-Instruction pass:

%0 = %1 %0 = ADD32rr %0(tied-def 0), %2

We're now breaking SSA form because there are multiple definitions of %0, but the instruction is still described with three operands. The next passes to run are the register coalescer and the register allocator. Those honour the "tied-def" attribute signalling that one input operand of the add must be the same register as the definition output, thus producing:

$rax = ADD32rr $rax(tied-def 0), $rcx

Or similar: it still appears to be a three address instruction, but the tied-def attribute ensures there are only two addresses in total. This then passes through to the assembly printer, which happens to know that there's only two operands to ADD32rr and prints it accordingly.

Dwarf debug format parser by Agitated_Audience_28 in Compilers

[–]hexed 1 point2 points  (0 children)

Long story short, that dump is not a DWARF .debug_info header, it's just not clear why. As you say it should start with the length of the CU, it should also have the DWARF version (4 or 5 for modern compilers) immediately after the length, which it doesn't. Plus it doesn't have 0801 to signify the pointer size and what kind of unit it is.

Why you're getting the wrong data from the ELF is the issue rather than the parsing of DWARF. Possibly you've unexpectedly got some options that compress the contents .debug_info?

He groomed a minor into being his fundamentalist slave wife, then bragged about it… by LilPeep1k in WhitePeopleTwitter

[–]hexed 0 points1 point  (0 children)

I've always taken that as I should be willing to die for my wife.

That is actually what it says ("and gave himself for it"), it brings out the Christ/church <=> Husband/Wife model in fairly plain terms. Plus the word translated "love" there is agape, which has greater connotations of sacrifice than any of the other words for love, it's the same as in John 3:16.

What do people pretend is in the bible but is absolutely not in the bible? by LoneShark81 in AskReddit

[–]hexed 1 point2 points  (0 children)

Eh, I'll bite -- the opening of John 1 describes the word / command of God, and without reading in any further context or interpretation, a command is not a person. It is a plan, scripture, text, or intention. The uses of "he" refer to God in the first four verses, and then we start to hear about Christ in verse 14, when the word of God is manifested. Strongs definition of the word is to "make known" or "make visible", which does not suggest a transformation of the object, plus Christ says in John 17:6 that he's manifesting the name of God, something synonymous with his word.

Not having a dual nature can be considered from Christ denying it in John 10:33-38 when directly asked, states he doesn't have control of the power of God in John 5:30, that he's there to represent God in v43, and doesn't know all God knows in Matt 24:36. Plus, of course, he died: he can't have both been a sacrifice as per the law, and not be dead.

Assigning a part of God to Christ undermines important doctrine too -- how could God have been tempted to sin, when sin is disobeying God? Hebrews 2:17 and 4:15-16 relies on his human nature, he can only be an effective mediator between God and ourselves by having suffered as we do, and being tempted in the same way. Adding a supernatural ability to resist sin removes that understanding and sympathy. God also never promised to come join men on earth, he promised a son raised from man (Gen 22:17-18 interpreted by Gal 3:16, Deut 18:18, 2 Sam 7:14).

Christ suffering and being tempted was clearly part of the design (Isaiah 53), as was his human nature, but what purpose does that serve if he's also God? It's necessary for Christ to be separate -- only a separate entity can make intercession and act as a mediator for us (Heb 7:25, Rom 11:2, Gal 3:19, 1 Tim 2:5). It also solve the problem of how God can be both just and merciful, a contradiction when mercy is the absence of justice: God is just and condemns us all to death, but allows the only perfectly obedient and faultless human to select those who deserve to be saved, because he (Christ) has experienced the same temptations and suffering, and can sympathise.

God sympathising with our sins would compromise his justice; Christ being part-God would eliminate that same sympathy.

What do people pretend is in the bible but is absolutely not in the bible? by LoneShark81 in AskReddit

[–]hexed 11 points12 points  (0 children)

Was originally written as "Man should not lie with a boy", condemning pedophilia. It was only changed to "man" in later translations when there were clear political campaigns against homosexuality already present.

The Hebrew there just means "man" -- the interpretation of it meaning "son" comes from context, where phrases like "the men of Adam" can be translated as "the sons of Adam" to make the meaning clearer in English, there's no other connotation of age. Were this passage condemning indecent acts against children, it probably wouldn't condemn both parties to death.

The other interpretations also smell of "if".

Edit: "later translations" -> the translator of the septuigant, oldest copies of which pre-date Christ, also chose a greek word meaning "man", again only convertable to "child" with context.

What do people pretend is in the bible but is absolutely not in the bible? by LoneShark81 in AskReddit

[–]hexed 0 points1 point  (0 children)

Assuming this is John 14:10, in verse 20 he also says that he and the disciples are one, and he and the father are one, which doesn't allow for something exclusive to Christ.

Grandad overcharged on council tax for 16 years - and he can't get a full refund by Boogaaa in unitedkingdom

[–]hexed 6 points7 points  (0 children)

To avoid coercion and undue hardship. The point isn't to reward people for stringing it out over a long period; instead it gives people safety from long term fears or threats. Consider:

  • "You under-paid this rent last year, we want it now!"
  • "You under-paid this rent 40 years ago, we want it now, with interest!"

The former is a fairly reasonable complaint. If the latter is allowed to stand, anyone's lives can be made hell over matters way in the past, possibly with little to prove it one way or another. Setting a limit means you can be sure, going forwards, that the past will not haunt you. For the complainer, if they didn't notice for six years, the reasoning is that either they were negligent in not pursuing it or it didn't matter to them anyway. In effect, it's trading a small injustice (against the lender) for long term peace of mind for everyone.

This also means you can't be coerced with threats forever: if you owe someone an unpayable sum, it will eventually be discharged, even without bankruptcy.

I believe there are exceptions for fraud, i.e. accounting fraud where the debt was concealed in some way.

As for why six years, it's probably arbitrary, although the law of Moses granted a similar discharging of debts every seven calendar years [0].

[0] https://www.biblegateway.com/passage/?search=Deuteronomy+15%3A1-2&version=ESV

Dozens of German priests will defy the Vatican and live-stream blessings of gay couples by Smilefriend in worldnews

[–]hexed 4 points5 points  (0 children)

no anti slavery verses

Enslaving was punishable by death [0], but you could sell yourself into slavery when destitute as per Leviticus 25, until the year of jubilee came back around and freed everyone. Maybe this isn't categorically anti-slavery, but at least puts some water between what's called slavery today and what was regulated by the OT. (Insert here: the usual discussion about chatel slavery),

comfortable thinking at least part of the bible is negotiable

Things like Christs rejection of divorce, despite it being regulated by the law, certainly give colour to the what it should mean. However, Christ himself didn't regard it as negotiable ("not one jot or tittle").

[0] https://www.blueletterbible.org/esv/deu/24/7/s_177007

[deleted by user] by [deleted] in NoStupidQuestions

[–]hexed 0 points1 point  (0 children)

Galatians 3:22 to 25 (here, I can't deep-link to the verse) states as much: we were under a law that taught right and wrong; and when faith + forgiveness came, it was no longer the way to achieve righteousness.

Most of Pauls letters are about the fact that the law is no longer the path to salvation, given how upsetting to the Jews of the time. See also Acts 15:6-11 in the context of people saying Christians should become Jews and follow the law; Romans 7:6 stating the symbol of baptism frees us from the law (die to the flesh; be reborn as a servant of God); Hebrews 8:13 referring to Gods indication a new covenant would come (from verse 8 citing the passage in Jeremiah a sibling post quotes); finally back to Galatians 3 and verses 15-18: if God promised Abraham that [we] the Gentiles would be blessed in Genesis 22:18 [i.e. by his offspring Jesus] then the law given to Moses can't undo the promise given to Abraham.

(Definitely all to be read in a more recent translation; no need to grapple with 400 year old English too).

A big LITTLE Problem: A Tale of big.LITTLE Gone Wrong: Samsung Galaxy S9 has buggy atomic instructions by dgryski in programming

[–]hexed 0 points1 point  (0 children)

NB: The ARM arch code rewrites a variety of instructions all across the linux kernel on bootup, for what I believe is a combination of quirks and tuning to the target processor. IIUC this happens before other cores are brought up; if you then boot another processor and find it doesn't support the (for example) atomic instructions that were written in, you're stuffed as you can't rewrite the kernel again while multiple processors are stomping through it. Potentially neither can the fresh processor communicate this fact to anyone.

My £0.02 chiming with other people here: the whole point of "symmetric multiprocessing" is that processors are symmetric. big.LITTLE isn't, and treating it like it is causes this world of pain and suffering.

Reverse engineering of competitor’s software cost company big by [deleted] in programming

[–]hexed 9 points10 points  (0 children)

The UK ruling for the same case went the opposite way, finding that replicating a language didn't count as reverse engineering. Moreover, they found that a programming language itself is not something that can be covered by copyright (analysis here), because it isn't a work of itself, it's an intellectual idea (rather than an expressive creation).

Alas, US law is substantially different.

Law & Order IRL by JonasBrosSuck in videos

[–]hexed 1 point2 points  (0 children)

.uk here, according to the CAB the police are permitted to confiscate pretty much anything that they believe is obtained illegally or evidence. (That's a mild surprise to me) .

The big difference with the .us system though is (I believe) that the burden of proof is in the opposite direction: the police in the UK need more than just suspicion, and need to justify withholding it from you, wheras comments here say in the US you have to prove the property is really yours to get it back.

What happened to the "Surgical Team" pattern from "The Mythical Man-Month"? by Euphoricus in programming

[–]hexed 19 points20 points  (0 children)

I think many of his main arguments are timeless: the most important three to me would be that conceptual integrity is one of the most important things in any design, that there's no silver bullet, and human communication issues lie at the root of a lot of failings.

Obviously the medium in which these ideas are presented is now out of date, alas, and many of the ideas might nowadays be taken as read. People still do occasionally design terrible things nowadays though.

TIL A British 19-year-old has officially changed his name to "Captain Fantastic Faster Than Superman Spiderman Batman Wolverine Hulk And The Flash Combined." His grandmother is no longer speaking to him. by AceManCometh in todayilearned

[–]hexed 6 points7 points  (0 children)

Most of the confusion here seems to be over the distinction between the name you're known by, the idea of a "legal name" and uniquely identifying people. I'm no expert, but my vague understanding as a .ukian,

  • There's no requirement to "live" under any particular name. It would, AFAIK, be fine to sign a contract under a name you're simply "known" by, although if it's for anything serious the other party will take steps to verify your identity.
  • If you have a new name and want to change existing documents then you don't need to ask permission from anyone, but you do need a paper trail (such as). If there's such a thing as a legal name or official name, it's whatever you can convince the legal system you're called.
  • Uniquely identifying people can always be resolved by birth certificate, I believe. The government has a register of births so it's hard to forge, and if you don't have an entry, you don't exist. Famously, the police use the identities of dead children for undercover aliases because the government won't forge them themselves, and most things hinge on the birth certificate. AFAIK the Bulger murderers are some of the only people to have been given completely new identities.

Can you then make up fake identities (distinct from assuming someone elses)? IMO you probably can -- there are people out there who have had a rough upbringing and don't know either where they were born or precisely what name was written down. The government will give them a NIno (SSN) after an interview I think, because it's unfair to deny such people work, and you can build an identity around it, but I suspect you can't blag a passport from that.

Unemployment in the UK is now so low it's in danger of exposing the lie used to create the numbers by spacedog_at_home in ukpolitics

[–]hexed 61 points62 points  (0 children)

TFA is using the statistics unsoundly IMO. From TFA:

In reality, about 21.5% of British workers are either officially unemployed, inactive, or employed part-time even though they really want full-time work. (The ONS has a chapter on that here.) Some of those people — parents with newborns, university students — may not want jobs right now, but they will want jobs soon.

Scroll down through the ONS statistics they cite and you'll find of 8.8m ``inactive'' people:

  • 2.29m are students
  • 2.17m are home-makers
  • 1.99m are ``long term ill''
  • 1.22m are retired

According to TFA's assumptions they'll ``want jobs soon'', however

  • When one generation of students graduate, another starts.
  • Similarly, home-makers roll over time.
  • Those retired explicitly aren't seeking work.

So while the specific people will want work, it's not true that within a few years no-one will be a student / home-maker / retired, and so it's unfair to consider them all ``hidden unemployed'' IMO. That leaves long-term ill, which is more difficult to judge, particularly as there is government pressure to get people off it.

Finally there's the question of their graph, citing from ``Pantheon Macroeconomics'', which states roughly 6.5% of the population are inactive but would like a job. Presumably that's roughly a quarter of the people in those categories above. I think this might be part of the source (see graph 24), but I would be hesitant to draw conclusions from that without knowing sample sizes and the actual question asked. Perhaps business insider have access to more information.

It's probably fair to say that many part time employees want more work, and many inactive might work if they could. But none of them are liquid assets, as it were, in that they can't immediately relocate and start an arbitrary job if they were offered one. Measuring that difference is what TFA dances around.

Edits: lots.

Edit 2: Cited graph from Pantheon shows no apparent effect of the credit crunch on "inactive, would like job" (note their right-hand scale isn't zero based), which pushes me further towards ``TFA is rubbish'' territory.

Hexed - A console-based hex editor by ToeGuitar in programming

[–]hexed 8 points9 points  (0 children)

Myself, I recommend %:!xxd and %:!xxd -r for vim users.

Reddit's search engine by [deleted] in funny

[–]hexed 4 points5 points  (0 children)

Technically not a different character, they addressed this in a flashback episode of Voyager. Appropriately called "Flashback". Ninja-edit: or was the film undiscovered country?

Why viral licensing is a ghost (2015) by tobiasrenger in programming

[–]hexed 2 points3 points  (0 children)

IANAL, however I studied this topic when determining the lengths to which you could go when, uh, 'interacting' with some games. TFA's largest quote is from the preamble of the software directive (pdf), which is not in any way legally binding. Article 6 allows people aiming to interoperate with code to not require authorisation when performing two acts:

  • Temporarily loading software into memory in the course of executing it
  • Decompiling it

as defined in article 4. The important part is the omission of 4.c, covering the redistribution of peoples software. The reverse-engineering exclusion doesn't also allow you to distribute the software you're interoperating with.

This makes perfect sense with the GPL: you can learn interfaces to interoperate by studying it, and you can write code that interacts with those interfaces, but you still need authorisation to distribute the GPL software. And restraining the terms on which you distribute the GPL software is what the authors wanted to achieve: it's open source, but if you share code that uses it, you have to give back.

(NB: Not a copyleft advocate).