Following my recent work running shadow system tests on the K1, I decided to extend the analysis to SpacemiT’s K3 SoC. The K1 and K3 belong to different generations of SpacemiT’s SoCs, making them ideal candidates for evaluating how architectural advancements impact low-level system utilities like shadow.
For this comparison, I used Fedora 44 Omni with shadow-utils-4.19.0-7 on both SoCs. The hardware configurations differ significantly, particularly in CPU architecture, memory, and storage:
| Feature | K1 | K3 |
|---|---|---|
| CPU Cores | 8 x60 (in-order) | 8 x100 (out-of-order) |
| RAM | 8GB | 16GB |
| Storage | SD card | NVMe SSD |
| Network | Local | Remote facility |
As detailed in the K1 post, SSH access is required to run the tests. For both the K1 and K3, I reused the same key-based authentication approach with root login enabled. The steps are identical to those described previously:
/etc/ssh/sshd_config) to enable PermitRootLogin.For reference, the commands are:
dnf install -y vim
vim /etc/ssh/sshd_config
# Ensure PermitRootLogin is set to `yes`
systemctl restart sshd
Before running the tests, I measured the compilation time for shadow on both platforms:
| Platform | Compilation Time |
|---|---|
| K1 | 5 minutes, 54 seconds |
| K3 | 1 minute, 27 seconds |
The K3 compiled the code ~76% faster than the K1, which aligns with its superior CPU architecture (out-of-order execution) and NVMe storage. This performance gap highlights how both CPU microarchitecture and storage technology can impact build times.
For both SoCs, I used a similar pytest-mh configuration to define the test topology. The mhc-k1.yaml and mhc-k3.yaml files specify the host, user, and artifacts to collect. Below is the template used for both:
provisioned_topologies:
- shadow
domains:
- id: shadow
hosts:
- hostname: shadow.test
role: shadow
conn:
type: ssh
host: <k1_or_k3_hostname>
user: root
artifacts:
- /var/log/*
The virtual environment setup was consistent across both platforms:
cd $(SHADOW_REPO)/tests/system/
python -m venv .venv
source .venv/bin/activate
pip install -r ./requirements.txt
I executed the test suite using the following command:
time pytest --mh-config=mhc-<k1_or_k3>.yaml --mh-lazy-ssh -v
newgrp, vipw and interactive related)newgrp, vipw and interactive related)| Metric | K1 (In-Order, SD Card) | K3 (Out-of-Order, NVMe) |
|---|---|---|
| Compilation time | 5m 54s | 1m 27s |
| Execution time | 9m 24s | 29m 7s |
| Tests passed | 118/126 | 136/144 |
| Tests failed | 8 | 8 |
newgrp, vipw and interactive), suggesting that these failures are likely due to the nature of the tests rather than hardware limitations.The comparison between SpacemiT’s K1 and K3 SoCs underscores the importance of architectural choices in system-level testing. While the K3’s out-of-order execution and NVMe storage significantly improved compilation performance, the remote facility access introduced network latency that impacted test execution times. For developers targeting RISC-V, these results emphasize the need to consider both CPU microarchitecture and storage technology, as well as network conditions, when designing or debugging low-level software.