It’s great work and an inspiration
This doesn't mean that the openness extends easily to those outside China, its culture, and especially its language though.
For example the popular arm rockchip offerings are so bad at contributing to mainline linux or even sharing documentation that the single person supporting them dropped it due to lack of fund and being unable to get any contact to share documentation.
IMHO, chinese opensource does at best the same thing many western companies do:
Opensource the things that are not you secret sauce/income, or things which would benefit you if people adopt them.
With the added caveat that china in generally is notorious for not abiding by patent laws and copying.
Upstreaming the kernel support has never been a breeze for any ARM designs, IIRC. But the custom kernels are GPL [1], aren't they?
What you don't look for you don't see. I see a huge contribution in OSS from contributors based in China.
In the west, being hard-to-copy often just means slapping a proprietary license on your software and not worrying about much else. THe "source available" model is a prime example, the software is trivial to copy in theory, but everybody knows there would be legal consequences, so nobody serious actually does it.
In China, this doesn't work, so you have to obfuscate your code, build anti-reverse-engineering protections etc. This is similar to how the gaming market works in the west.
There are plenty of great writeups on reverse-engineering Chinese apps and hardware, and their reverse-engineering protections are often far more elaborate than what those same apps would have if made by western companies.
all successful cultures are, they're just divided on whether they admit it or not. Germany was late to industrialization and a lot of our businesses went to Britain under the pretense of doing business and copied chemical plant factory layouts one-to-one, but we like the "we're the country of engineers and thinkers" story much better than "we were a bit slow and ripped the British and French off".
The Chinese just don't pretend. I've spent a lot of time in China and around FB's attempted Snapchat acquisition in tech circles there used to be the joke that FB is the most Chinese American company because of Zuckerberg's relentless copying. The valley works the exact same way, they're just more likely to pretend everything is the result of some boy genius making it up.
The purpose of RISC-V was to have a boring, unencumbered ISA that everyone could freely implement. It was a patent play, not a technical advancement.
There, one of the things they mentioned was that they were hoping that RISC-V in general, and their cores in particular, becomes a platform for academic research. That way, cutting-edge things are shared in the open and the industry benefits globally.
The optimistic view of this is that it's hoping for a better future for all. The cynical view is that open source is much harder to sanction/export control. The truth is probably somewhere in the middle.
You can see the same with Apple and all big tech funding OpenStreetMap for example vs Google Maps. Even decreasing income for the competitor is worth it strategically. Or Satya Nadella saying in an interview that if ChatGPT just makes Google's costs higher for search is a big win for Microsoft.
It's because you cannot make money with it anyway and the university often allows it, so then it's really good for your CV.
In Europe there is also a lot of stuff open source, and I can honestly say there is no plot by the government to destroy the United States. I don't think Linux is a plan by the Swedish government to destroy the USA.
Most Chinese people in my experience also don't really have any country outside of China on their radar, unless they are in some trading business. China is just so huge compared to for example the US, they really live in their own bubble. It's not something they think about on a monthly let alone daily basis is my personal experience.
This makes life easier for competitors, so it's definitely a tradeoff, but it's the right tradeoff in some circumstances.
I think this is greatly overstated. Generally it's just sheer volume of capital and dedication to building a business that dictates market advantage, not any given persons' knowledge or know-how (though that's obviously worth paying for if you have the capital). I'd argue the primary reason why proprietary ownership of software exists isn't to make life harder for competitors but rather to make it harder for folks to figure out what they're actually paying for and bypassing the fees to actually fix (let alone improve) the software.
Linus comes from a family of ethnic Swedes, but he was born and raised in Finland, the Swedish government had nothing to do with it.
# Dockerfile
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y build-essential clang libclang-dev llvm-dev cmake libspdlog-dev vim git curl wget time default-jre default-jdk
RUN git clone --recursive https://github.com/OpenXiangShan/xs-env
WORKDIR /xs-env
RUN sed 's/apt\S* install/\0 -y/g;s/source /. /g;s/sudo //g' -i ./*.sh
RUN . ./env.sh && sed 's/\/master/\/master/g;s/$/; cd \/xs-env/g' -i ./update-submodule.sh && ./update-submodule.sh
RUN . ./env.sh && ./setup-tools.sh
RUN . ./env.sh && . ./install-verilator.sh
RUN . ./env.sh && sed 's/^git submodule.*$//g;s/env.*$//g' -i ./setup.sh && . ./setup.sh
RUN . ./env.sh && make -C XiangShan init
RUN . ./env.sh && cd DRAMsim3 && mkdir build && cd build && cmake -D COSIM=1 .. && make -j 8
RUN . ./env.sh && make -C XiangShan emu CONFIG=DefaultConfig WITH_DRAMSIM3=1 MFC=1 -j 8
RUN . ./env.sh \
&& sed 's/unknown-//g;s/rv64gc/rv64gcv/g' -i $AM_HOME/am/arch/*.mk $AM_HOME/am/arch/isa/*.mk \
&& sed 's/define MSTATUS_FS.*$/define MSTATUS_FS 0x6600/g' -i $AM_HOME/am/src/*/isa/riscv/boot/*.S
WORKDIR nexus-am/apps/hello
RUN make ARCH=riscv64-xs
# $NOOP_HOME/build/emu --no-diff -i ./build/hello-riscv64-xs.bin 2>/dev/null
Make sure you have 64GB of RAM. I only had 16GB, but allocating additional 48GB of swap worked.There are probably some redundant steps, but this worked for me last time I tried.
Or you just use it to compile programs against it?
edit: I did skim the readme, I saw verilog makes me think FPGA
I've run CPU simulations on machines with 64GB of RAM before and it took several hours just to get to single-user shell in Linux. Different CPU design and computer, but the point is it's not something you'd typically use interactively.
i.e. on the order of a million times slower than the final product.
On an FPGA you might get 20 to 50 million instructions per second, only 100 times slower than the final SoC product. But for a large modern OoO design you'll need an FPGA costing $15000 (for a VCU118) or even more.
I suspect it is the Scala compilation that requires all the RAM rather Verilator or the simulator.
For people interested, there's bi-weekly blogs (some in English) linked here: https://docs.xiangshan.cc/zh-cn/latest/blog/
However, after a VERY short perusal, I grew a giant sense of empathy for non-native English speakers. The readme is gentle enough to English speakers (aka: +95% English) no less I felt like I muddled through renaming tokens in my mind as I went. However, that quickly showed me two things.
1. It reminds me why I never seem to finish classic Russian literature… so often get lost in the introductory parade of names that are a cache miss for my usual set of names.
2. This is perhaps a significant cultural muscle that has never been necessitated for English speakers. Since the earth has largely been using English (in some capacity) for significantly longer than my life span - as my favorite joke says in the punch line “what do you call someone who only knows one language… uni-lingual… jk: American”
PS: it seems like there could be an open registry maintained by “Americans like me” who would rather pre-process the code for tokens within the docs and src… seems like a “DefinitelyTyped style” definitions registry would be very niche, but SUPER useful.
"Another thing to keep in mind, when you get to feeling bad about being monolingual, is that the fair question is not 'how many languages do you know?' It is, 'of the languages spoken by five million people or more within a thousand miles or so of where you live, what percentage do you know?'"
IRL interactions are just one aspect of life. Pretty important, sure, but it’s not the only important thing.
In the case of the US the languages that would meet that criteria in most parts of the country would be English and Spanish. But there are also hierarchies around languages, ie people that speak the more dominant languages are less likely to speak the less dominant languages, but the speakers of the less dominant languages are expected to speak the more dominant languages and suffer higher consequences if they don’t.
This is why it's so much easier to only speak English than it is to only speak another language.
It’s pretty easy to only speak German within the DACH countries. Huge online communities as well that speak German.
I’d wager it’s similar for several other large languages, e.g. Spanish or Chinese, OTOH they are even larger, OTOH they probably don’t have the same advanced dubbing industry that we have.
> one for Spain and one for LATAM
What’s the difference there for someone who is only bilingual (English and German)? :D
An example that comes to mind, as a first year Spanish student (I'm doing my best but fact check me because I'm very much still learning!) with a Latin wife, is "el carro," which means car, and is common in some Spanish speaking countries but others might use "el coche" -- I believe this dialectic difference even exists within Latin American Spanish speaking countries!
There are differences in pronunciation too but that obviously doesn't apply to subtitles
But yes, it is mostly a difference of vocabulary, accent and pronunciation, and also how or if to translate the names of characters and the movies themselves.
By that metric you shouldn't feel bad for not speaking Russian in most of Russia, or for not knowing the most common languages in your immediate surroundings in large swaths of Africa (i.e. most Bantu languages would be excluded).
The list of fused instructions is kinda weird; besides the ones that correspond to SH{1,2,3,4}ADD anyway, I don't think I expected any of the others.
I don't see a mention of Sifive-style short jump predication there either, though I'm using Google Translate.
0. https://old.reddit.com/r/RISCV/comments/1hnm5y1/where_did_th...
Refer to the "base instruction" column in the pseudoinstruction table[0].
0. https://github.com/riscv-non-isa/riscv-asm-manual/blob/main/...
The only other source I know of was this 2016 paper that suggested specific macro fusions. https://arxiv.org/abs/1607.02318 This predates the B extension so some of those fusions are dedicated instructions now, but I suppose Xiangshan still implements them for the sake of software that was not compiled with B enabled.
While Arm CPUs have existed for 40 years, the initial RISC-V spec was frozen and formally published only in mid 2019 and most of the CPUs currently available to buy were designed around that time.
This is quite normal. For example the Arm A76 core that features in the latest Raspberry Pi 5 and RK3588 boards (Rock 5, Orange Pi 5) was announced in May 2018, and took until 2022/3 to be available in consumer SBCs. The A53, A55, and A72 had similar time spans from announcement until being available in SBCs: Pi 3 / Odroid C2; Odroid C4; Pi 4.
Only in November 2024 was a RISC-V ISA spec suitable for high performance phones, laptops, desktops, servers frozen and published: RVA23. Cores meeting this spec and with expected performance comparable to Arm A78 up to maybe X2 have been announced, but it will be several years before they are available in products.
RISC-V is simply very very new. It is doing very well in the markets which it currently addresses.
"The latest version of XiangShan achieves a normalized score of 45 at 3GHz on SPECint 2006. With the performance comparable to ARM Neoverse N2, it is the highest performing open-source processor to our knowledge."
https://riscv-europe.org/summit/2024/media/proceedings/poste...
https://hc2024.hotchips.org/assets/program/conference/day2/2...
They will continue to improve the performance.
TLDR in RTL simulation XiangShanV3 out-performs my current desktop (Zen1) per cycle in the tested scalar benchmarks by 2x. It's probably closer to 1.5x on regular code.
This roughly matches the reported SPECint2006 scores:
* XiangShanV2: 9.55/GHz
* XiangShanV3: 15/GHz
* Zen2 [1]: 10.5/GHz at boost, 9/GHz at base frequency (closest to Zen1 I could find)
For comparison: * Cortex-X1: 15.73/GHz
* Apple M1: 21.69/GHz
* SiFive-P670: >12/GHz
* SiFive-P870: >18/GHz
* TT-Ascalon: 18-20/GHz
* Akeana 5300: 25/GHz
Note that it's hard to find SPECint2006 scores for modern x86 or Arm cores because they all use PECint2017.The final clock frequency obviously also has a big impact, but XiangShanV3 target 3GHz which is quite decent.
All the tooling in this space is so expensive to build and expensive to verify, with such a small market that it seems almost impossible for something to ever challenge the incumbent ecosystems in a reasonable span of time.