ring icon indicating copy to clipboard operation
ring copied to clipboard

Test generic C implementations on a little-endian target on CI

Open Shnatsel opened this issue 3 years ago • 8 comments

Part of #1455

ring ships optimized assembly implementations for x86 and ARM. The generic C/Rust fallback implementations used on other architectures also need to be tested, and the test coverage needs to be measured. These targets can easily be run on Github Actions via user-mode QEMU; the blocker is of the lack profiler builtins support on most non-tier-1 architectures.

It has been recently enabled on s390x, and in fact enabling profiler builtins is really trivial - you just add a flag, test that it works, and open a PR: https://github.com/rust-lang/rust/pull/104304

But s390x is big-endian; we also need a little-endian test target. The obvious choice for this is little-endian POWER8, or as Rust calls it powerpc64le-unknown-linux-gnu. But testing that profiler-builtins actually work requires either access to POWER hardware or a complex cross-compilation setup.

Shnatsel avatar Nov 26 '22 23:11 Shnatsel

@erichte-ibm could you help with this? This should be trivial for anyone with access to POWER hardware, and it's a blocker for POWER support in ring.

I've been trying to rent a POWER VM through IBM cloud and do it myself, but the signup process rejected all my debit cards, and when I reached out to support about it they suspended my account without explanation.

Shnatsel avatar Nov 26 '22 23:11 Shnatsel

IntegriCloud offers POWER9 VMs: https://www.integricloud.com/

grubles avatar Dec 03 '22 18:12 grubles

Sadly their pricing is starts at $325/month, and all I need is to run a one-off test on real hardware - the rest can be done in qemu. $325 is quite pricey for what's going to be just a day of usage.

Shnatsel avatar Dec 03 '22 18:12 Shnatsel

That's for dedicated hardware. I think the cloud offering is much cheaper.

grubles avatar Dec 03 '22 19:12 grubles

Ah, indeed it is, and you can pay in smaller increments too. Nice, thanks!

Shnatsel avatar Dec 03 '22 20:12 Shnatsel

A PR for profiler support on little-endian POWER is up, tested on integricloud: https://github.com/rust-lang/rust/pull/105389

Shnatsel avatar Dec 06 '22 19:12 Shnatsel

I'm working on getting the profiler up on mipsel for my own purposes. Once I've got that done, this should be solvable.

I'm encountering a weird bug in building with profiling, Rust is pulling in something it shouldn't and I can't figure out where/how it's getting it. Once I've got that resolved, the rest of this should fall rather quickly.

https://github.com/rust-lang/rust/issues/112313

SeanMollet avatar Jun 05 '23 13:06 SeanMollet

This is basically done. Code coverage is reported for the generic code for 64-bit big endian and 64-bit little endian. I don't know of a good 32-bit target in either big endian or little endian that is Tier 2 or higher AND that has profiler builtins. Thus coverage for 32-bit is getting reported pessimistically; i.e. the coverage is a lot better than the coverage reports would indicate.

briansmith avatar Oct 02 '23 03:10 briansmith