HNHacker News
TopNewBestAskShowJobs

arthur2e5

1,125 karma · joined April 29, 2016

zh-CN-N, en-US-5.
submissionscomments
arthur2e5··on Intel MKL on AMD Zen
The new mkl_serv_intel_cpu_true() function seems to have been known since Agner Fog's 2019 update. I am quite surprised that no changes to the feature indicator was needed though.

If you are publishing an application, I still recommend using the intel_dispatch_patch.zip.

arthur2e5··on WD Sets the Record Straight: Lists All Drives That Use Slower SMR Tech
Case in point: on April 23, they proposed to retire the only flag that identifies device-managed SMR drives in the new SCSI standard.

Weber, Ralph O (April 23, 2020). "SBC-5, ZBC-2: Obsolete the ZONED field". <https://www.t10.org/cgi-bin/ac.pl?t=d&f=20-054r0.pdf > (registration needed)

arthur2e5··on SBC-5, ZBC-2: Obsolete the ZONED field [pdf]
This is Western Digital's response to the SMR uproar a while ago: let's remove the flag that identifies SMR devices!

The URL requires registration from the SCSI guys (T10) site, and I would appreciate it if someone posts a link that does not require this.

arthur2e5··on CVE-2019-18183 (2019)
TL;DR: Pacman did a

    snprintf(command, PATH_MAX, "xdelta3 -d -q -s %s %s %s", from, delta, to);
    system(command);
And to fix it, they removed the delta update feature.

* * *

They removed a feature that could work well over something someone did incorrectly. You don't even need to go full-on execvp and dup2 to fix this problem:

* it is super easy to escape a string for POSIX shell: wrap the thing in single-quotes, replace the single-quotes in-between with '\''

* it is not hard to verify that snprintf has enough space: just assert(snprintf(bleh, size, ...) < size).

arthur2e5··on Glibc sysdeps: dl_platform detection effectively performs “cripple AMD”
The FMV (4.8) and clone (6.0) features are intended to be easier-to-use wrappers around ifunc. FMV-4.8 (C++) generates the ifunc dispatching code for the programmer, and FMV-6.0 (C/C++) moves on to do the code duplication for the programmer too. It is added with the assumption that GCC's optimization / vectorization magic is good enough to gain significant performance gains by just changing -march options on the exact same piece of code.
arthur2e5··on Glibc sysdeps: dl_platform detection effectively performs “cripple AMD”
A good way for the lazy person (me) to find out what processors have what instructions is simply dig in the GCC source code and see what their enormous tables have to say.

  For Zen since 2017 (znver1): https://github.com/gcc-mirror/gcc/blob/44e419819c4076843d0c92dc6913821a016a8519/gcc/common/config/i386/i386-common.c#L1673-L1681
  For Haswell (haswell): https://github.com/gcc-mirror/gcc/blob/b2903606a95ff609a65abe7ac0cbf4321ad2614d/gcc/config/i386/i386.h#L2372-L2382
If you collect all these entries and do some set operations on them, it should boil down to znver1 having a bunch of extra things compared to haswell {"SSE4A", "ABM", "PRFCHW", "MWAITX", "ADX", "RDSEED", "CLZERO", "CLFLUSHOPT", "XSAVEC", "XSAVES", "SHA"} and haswell only having a HLE (Hardware Lock Elision) extra. HLE is designed to be fully backward-compatible, so yes GCC Haswell code will work on Ryzen with no illegal instructions.

With these very textual and probably super easy-to-parse bitset data, you should also be able to answer the "what previous things are missing" question as well. You should be able to see some historical divides with ssse3/sse4a and fma3/4 et al.

* * *

About the completeness of the check: trust me it is complete enough to only include all extant processors that are supersets of Haswell. POPCNT plus AVX2 narrows it down a quite lot.

arthur2e5··on Glibc sysdeps: dl_platform detection effectively performs “cripple AMD”
Read the bug again! The feature is about "transparently" loading libraries that are put in specific subdirectories based on the CPU so that a single configuration can work fast everywhere. Intel's Clear Linux wrote about that in https://clearlinux.org/news-blogs/transparent-use-library-pa....
arthur2e5··on Glibc sysdeps: dl_platform detection effectively performs “cripple AMD”
"Code cannot tell the future" is also the 2009 excuse Intel gave for icc not supporting processors that are GenuineIntel but not Family 6, incidentally. History is wonderful, isn't it? Back in the days we already knew what the still-current best practice to see what flags a CPU has is.
arthur2e5··on Ask HN: Will software license be feasible for labor protection?
So uh I did the current draft license in the repo, which is meant to be an additional restriction for whatever license a project is originally supposed to use. The idea I mean to show is that to exclude 996-type practice, you should use a more general definition that involves a work week and consecutive hours at work. There is no consideration on whether it will work: bad actors who violate labor laws tend to not care about FOSS licensing either. History tells us unionization and strikes would work better, but again recent Chinese news tells us with those you end up in a jail.

Feasibility aside, I was dumb enough to not include something that says you gotta keep the restriction in modified version. https://github.com/996icu/996.ICU/pull/24748 is a fix that should get merged soon. There's also a notes on use section, which basically says:

1. It would not be GPL compatible because it adds an restrictions. Use it on more permissive licenses like MIT.

2. If you do use it, consider dual-licensing with GPL or AGPL so more people can potentially use it. Corps that do care about legal stuff don't like GPL anyways.

arthur2e5··on LC4: A Low-Tech Authenticated Cipher for Human-To-Human Communication
In case you find the alphabet too small, there's a variant called ls47 (https://github.com/exaexa/ls47) that runs on a 7x7 tile with ~128 bits of security. It also suggests a key expansion algorithm.
arthur2e5··on Optimization of Fontconfig Library (2017, PDF)
In case you are looking for the patched library, it's at https://github.com/michalsrb/fontconfig.
arthur2e5··on Hidden Away for 28 Years, Tiananmen Protest Pictures See Light of Day
It may be a good idea to try blending some massacre (um, because WP:COMMONNAME, a.k.a. "everyone mentions the massacre"?) in and call it some "protest and massacre" though.
arthur2e5··on Google’s AlphaGo Defeats Chinese Go Master in Win for A.I
I mentioned some of this censorship in https://news.ycombinator.com/item?id=14403809. A tieba (your random big BBS site; https://archive.fo/0mh1t#selection-4961.0-4961.16 reply #10) link from http://archive.is/tTgsx (solidot, Chinese version of slashdot) points to a ban on mentioning Google by name & doing commentary on AI, and suggests doing a indirect livestream by showing a separate board instead. Someone's YouTube livestream mirror on Bilibili was supposedly taken down after the B site made it too public by putting it on the front page.

According to the tieba page, the ban was first noticed as CCTV5 deleted their Weibo (a microblogging service) post on the livestream.

Welcome to the 4th part of confidence doctrine -- cultural confidence.

arthur2e5··on The Future of Go Summit – Ke Jie vs. AlphaGo
They were ordered to censor the video livestream (only allowing text) just ~1d before the event though.[0] Rumor has that the censorship order explicitly called for avoiding mentioning Google in the text streams. A YouTube mirror video livestream on Bilibili has been taken down for unknown reasons.

[0] http://archive.is/tTgsx (original page already gone)

It might not be the gov't intending to act evil in this case -- it can be some random "old red army" hearing about Google's involvement in this thing and protesting. But no matter what the underlying reason is, they are defly trying to hide something they are not supposed to in order to make stuff look good. (They ain't no White Lotus.[1]) You don't need an evil overlord to do this; a narcissist will suffice.

[1] https://baike.baidu.com/item/白莲花/17505528

arthur2e5··on A social coding experiment that updates its own code democratically
Discarding votes after `rebase` commits looks like a pretty bad problem now: https://github.com/chaosbot/chaos/pull/26
arthur2e5··on On Chinese Writing: Evolution
There are quite a few on Wikipedia (https://en.wikipedia.org/wiki/Second_round_of_simplified_Chi...). I would say the most commonly seen are 仃 for 停 (stop, park a car), 桔 for 橘 (orange), and less commonly 歺 for 餐 (meal).

These are pretty vernacular writing now: you only see 仃 painted on walls near alleys where they tell you to park or not to park a car somewhere and 歺 is found around some small canteens. 桔 is a bit more popular than the other two among schoolkids.

arthur2e5··on /usr/bin/time: not the command you think you know
The `time` syntax in combination with for loops or just shell functions is pretty useful as well.
arthur2e5··on Partial WebAssembly backend for the GNU toolchain
There is actually another voice from Free Software advocates on the Oracle v. Google case, basically saying that Google could have been free from Oracle's trolling in the first place had they based their thing on the GPL-licensed OpenJDK.

A sample of such statements, from https://github.com/biergaizi, can be found at http://weibo.com/1219205751/Dov1ynGLk (login-walled).

arthur2e5··on Do we need a new heading element in HTML?
Chrome 58 gives a smaller font size (1.5em, same as <h2>) for <h1> elements under <section> and friends:

  /* user agent stylesheet */
  :-webkit-any(article,aside,nav,section) h1 {
      font-size: 1.5em;
      -webkit-margin-before: 0.83em;
      -webkit-margin-after: 0.83em;
  }
And <h1> keeps shrinking as you nest <section>s. So yes, someone has actually implemented it. (I personally don't like the <article> part, but well -- whatever.)
arthur2e5··on [dead]
Perhaps I should mention https://bestmotherfucking.website/ again.
arthur2e5··on [dead]
Try https://bestmotherfucking.website/ too. (I actually submitted both, but apparently someone thought it was a duplicate and flagged it.)
arthur2e5··on Updated Chapter 4 of Knuth's Art of Computer Programming (Jan 18, 2017)
A "(ps.gz)" suffix in the title?
arthur2e5··on USDA Approves Sale of Non-Browning GMO Apples
Many types of packaged apple slices in the U.S. seem to use salts of Vitamin C like calcium ascorbate.
arthur2e5··on GIMP – 2016 in review
The font cache re-runs every time you change your fonts folder.

It's like what you do with `fc-cache`, but on Windows you get per-application caches for apps that uses fontconfig (they carry their own copies of fc). Every time you install a new font or update your system, you have to do a recache for each of these apps.

arthur2e5··on OpenNMT: Open-Source Neural Machine Translation
As a terrible human being, I tested Chinese-to-English translations on f-word-based profanity on the demo page (https://demo-pnmt.systran.net/production). The results were arguably not as good as Google Translate, which can recognize the colloquial form 操[^1] but not the more orthodox 肏. PNMT's results were great in another way as they form more fluent English.

  [^1]: Everyone hijacked the character.
On the other hand, OpenNMT appears able to translate the "f* you!" sentence to "你妈!" in Chinese, a form of "操你妈" with the F word not spoken but implied. The single-f-word sentence generates amusing variations when used with different punctuations, although many ("...", "?", "!", "") fail by reducing the sentence to a normal call for one's own mother.

These experiments make me curious about what kind of corpora the system was trained on.

* * *

The test sentences used were:

    操你十八辈子祖宗![^2]
    操你十八辈祖宗!
    操你妈!
  [^2]: This one is technically wrong.
For the orthodox version, replace all instances of 操 with 肏.

As an additional experiment, I tested some variations of "mother" profanities without "操":

    1. 你妈!
    2. 他妈的!
    3. 他妈的。
Between #2 and #3, PNMT appears more sensitive to punctuations than human do. #1 is only included as a round-trip validation.

Edit: (#1) ... and is not supposed to be translated back into profanity due to high false positive rate.

arthur2e5··on Myths about /dev/urandom (2014)
libbsd is also using getentropy: https://cgit.freedesktop.org/libbsd/tree/src/arc4random.c
arthur2e5··on Research papers in the .NET source
Just for fun I searched for "pdf" and "paper" in the other popular .NET JIT runtime, and here's what I got:

    - SSAPRE: https://github.com/mono/mono/blob/0bcbe39/docs/ssapre.txt#L249
    - Dice, thin locks: https://github.com/mono/mono/blob/49c26ad/mono/metadata/monitor.c#L51
    - IBS Tree: https://github.com/mono/mono/blob/0bcbe39/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryIntervalOp.cs#L10
    - Huffman tree: https://github.com/mono/mono/blob/0bcbe39/mcs/class/referencesource/System/sys/system/IO/compression/HuffmanTree.cs#L16
    - GC survey: https://github.com/mono/mono/blob/0bcbe39/libgc/doc/gcdescr.html#L13
    - malloc survey: https://github.com/mono/mono/blob/0bcbe39/mono/utils/dlmalloc.c#L1501
arthur2e5··on Set Operations in the Unix Shell (2008)
A few gotchas here:

* "seq" is usually an external process. You may want to do it in bash's arithmetic for, use a while loop with `$(( ... ))", or write a `seq` function (you still need to spawn a subshell for command expansion though.)

* "(( ... ))" is not in POSIX shell, but "$(( ... ))" is. You should be able to get around with some [ "$(( blah ))" -eq 0 ] tests.

arthur2e5··on WoSign and letsencrypt.cn
It's true that they didn't impersonate letsencrypt, but they did:

1. Assign DNS records to these two domains and remove them after someone exposed these domains. https://groups.google.com/d/msg/mozilla.dev.security.policy/...; https://archive.fo/MQwMK; https://archive.fo/0HQZ7

2. Send marketing e-mails that exaggerate threats of using a "foreign CA", such as Let's Encrypt: https://groups.google.com/d/msg/mozilla.dev.security.policy/... (Well, "Percy" has always been bringing it up.)

While (2) has been something too old to keep bringing up, (1) certainly undermines some of Richard Wang's claim.

arthur2e5··on Ask HN: Is Wikipedia going to survive?
Taking how often they are doing edit-a-thons into account, it's possible that some of your money goes into recruiting new contributors. (WMF also has a scholarship for known-good contributors to attend these conferences.)
← PreviousPage 9 of 10Next →