Commit Graph

98 Commits

Author SHA1 Message Date
irvingouj@Devolutions 629154026d perf(graphics): portable SIMD inverse DWT (wide + SWAR) (#1383)
## Summary

On the WASM web client, frame **decode** dominates (~93% of frame time
on a 1080p RemoteFX replay), and within decode the **RFX inverse DWT was
~48%** (the YCbCr→RGBA convert is already SIMD via `yuv`; the
entropy/RLE stages are inherently sequential). This vectorizes the
inverse DWT with the portable [`wide`](https://crates.io/crates/wide)
crate (`i16x8`), so the same code lowers to **wasm `simd128`, x86
SSE/AVX, and ARM NEON** — desktop and browser both benefit.

The encode path is unchanged.

## How it stays bit-exact (no `unsafe`, no `cfg` split)

The lifting steps need i32 intermediates only for the averages.
Overflow-free SWAR identities let the whole kernel stay in `i16` lanes
(no widen/narrow):

- `ceil_avg(a,b)  = (a|b) - ((a^b)>>1)`  ≡ `(a + b + 1) >> 1`
- `floor_avg(a,b) = (a&b) + ((a^b)>>1)`  ≡ `(a + b) >> 1`

and `(2x+1)>>1 == x` / `(x+x)>>1 == x` simplify the first/last rows.
Every other op is wrapping `i16` arithmetic, identical to the old
`i32`-intermediate-then-`as i16` truncation.

## Performance

1080p RemoteFX replay, headless Chromium, wasm release `+simd128`,
8-pass median:

| inverse DWT | decode (ms) |
|---|--:|
| scalar (baseline) | ~1598 |
| **portable `wide` SIMD** | **~985** |

→ inverse DWT ~2×, **~39% off the decode stage**. (Absolute ms carry
~±15% machine-load noise; the ratio is stable. Per-frame this is a
throughput win — decode was already within real-time budget.)

## Correctness

Verified bit-exact three ways:
- the replay-bench **framebuffer CRC32** is unchanged,
- the existing **native DWT tests** pass (so it's exact on x86 too, not
just wasm),
- an **exhaustive** check of the SWAR identities over all `i16 × i16`
pairs (0 mismatches).

## Notes

- `wide` is a single-user dep in `ironrdp-graphics`; chosen over
`std::simd` (still nightly-only) and over per-arch intrinsics (one
portable kernel vs three).
- Reproducible bench branches: `bench/draw-*` (renderer) and the DWT
measurements were taken on the replay-bench harness branch (the capture
corpus is gitignored).
2026-07-21 15:39:34 +00:00
devolutionsbot c0a29813bf chore(release): clean up (#1440) 2026-07-10 16:59:01 +00:00
devolutionsbot 11a0810cfb chore(release): prepare for publishing (#1364)
Co-authored-by: Benoît Cortier <3809077+CBenoit@users.noreply.github.com>
2026-07-10 15:38:47 +00:00
devolutionsbot 8fe59c19e2 chore(release): prepare for publishing (#1340)
Co-authored-by: Benoît CORTIER <git.divisible626@passmail.com>
Co-authored-by: Benoît Cortier <3809077+CBenoit@users.noreply.github.com>
2026-06-17 16:22:15 +00:00
devolutionsbot 7dd4db0f62 chore(release): prepare for publishing (#1212) 2026-05-28 15:49:11 +00:00
Greg Lamberson ad3a84295a test(fuzz): add egfx_round_trip oracle and target (#1317) 2026-05-27 22:49:35 +09:00
uchouT 196d18dfaa feat(dvc): close channel API for server and client (#1302) 2026-05-26 16:54:46 +09:00
dependabot[bot] 9d12adab8e build(deps): bump log from 0.4.29 to 0.4.30 in the patch group across 1 directory (#1310) 2026-05-26 16:37:28 +09:00
Greg Lamberson 3dae1fbacc test(fuzz): add egfx PDU decoders to pdu_decode oracle + fix two surfaced bugs (#1271) 2026-05-25 22:54:24 +09:00
Greg Lamberson 610cfd0742 test(fuzz): add pdu_round_trip oracle and target (#1291) 2026-05-25 22:12:14 +09:00
Greg Lamberson a8a813a22d feat(fuzz): add bulk decompression fuzz targets (MPPC, NCRUSH, XCRUSH) (#1285) 2026-05-20 22:35:54 +09:00
Benoît Cortier 4c5301850b fix(connector)!: remove arbitrary feature (#1273)
The connector types are unlikely to benefit from random value generation
for fuzzing purposes; a more targeted approach would be preferable if
the connector is fuzzed in the future. We’ll reevaluate later.
2026-05-14 09:22:51 -04:00
Greg Lamberson af11df1fd0 feat(pdu): add arbitrary feature for structure-aware fuzzing (#1272) 2026-05-14 21:46:15 +09:00
Greg Lamberson 14c55027c8 refactor(pdu): hand-roll Display/Error impls and remove thiserror dependency (#1264) 2026-05-13 06:52:22 +00:00
dependabot[bot] ba8b8b30f1 build(deps): bump the patch group across 1 directory with 2 updates (#1248) 2026-05-08 21:10:25 +09:00
dependabot[bot] 3fe6d157e0 build(deps): bump the patch group across 1 directory with 2 updates (#1222) 2026-04-21 15:06:46 +00:00
dependabot[bot] b50a934c92 build(deps): bump the patch group across 1 directory with 2 updates (#1203) 2026-04-09 22:40:02 +09:00
Gabriel Bauman c98a8fb774 feat(cliprdr,web,ffi): implement clipboard file transfer support (#1166)
Add end-to-end clipboard file transfer (upload and download) across the
CLIPRDR channel per MS-RDPECLIP.
2026-04-09 14:53:39 +09:00
dependabot[bot] b588004956 build(deps): bump the patch group across 1 directory with 2 updates (#1183) 2026-03-24 09:34:49 +09:00
dependabot[bot] 0cca23fbdc build(deps): bump the patch group across 2 directories with 13 updates (#1105) 2026-02-18 03:16:09 +09:00
dependabot[bot] 5680b593d9 build(deps): bump the patch group across 1 directory with 6 updates (#1080) 2026-01-20 09:50:33 -05:00
Benoît Cortier 35e8753075 chore: clean up workflow config and remove unused npm dependencies (#1059)
- Clean up permissions and remove unnecessary fetch-depth settings from
release workflow.
- Clean up unused peer dependency entries from package-lock.json files.
2026-01-07 19:25:35 +00:00
dependabot[bot] 22bea60496 build(deps): bump the patch group across 1 directory with 4 updates (#1068) 2026-01-07 13:32:57 -05:00
devolutionsbot 87f8d073c8 chore(release): prepare for publishing (#1020) 2025-12-20 11:42:23 +00:00
dependabot[bot] 0903c9ae75 build(deps): bump the patch group across 1 directory with 4 updates (#1051) 2025-12-09 00:18:06 -05:00
dependabot[bot] cf978321d3 build(deps): bump the patch group across 1 directory with 6 updates (#1044) 2025-12-03 07:52:21 +00:00
dependabot[bot] bbdecc2aa9 build(deps): bump clap from 4.5.49 to 4.5.50 in the patch group across 1 directory (#1023) 2025-10-21 05:04:36 -04:00
Alex Yusiuk e87048c19b refactor: get rid of lazy_static (#1022) 2025-10-20 15:07:19 -04:00
devolutionsbot c6b5487559 chore(release): prepare for publishing (#1002) 2025-10-02 03:34:02 +00:00
devolutionsbot 209108dc2c chore(release): prepare for publishing (#997) 2025-09-29 11:07:48 +00:00
devolutionsbot 8dc41e2feb chore(release): prepare for publishing (#989) 2025-09-24 08:01:35 +00:00
dependabot[bot] fd43129b13 build(deps): bump the patch group across 2 directories with 4 updates (#968) 2025-09-08 23:46:33 +00:00
devolutionsbot 4beab02353 chore(release): prepare for publishing (#960) 2025-09-04 13:06:32 -04:00
dependabot[bot] 21fa028dff build(deps): bump png from 0.17.16 to 0.18.0 (#961) 2025-09-03 06:58:50 +00:00
devolutionsbot a3b2017e5f chore(release): prepare for publishing (#885) 2025-08-29 13:59:13 +00:00
dependabot[bot] c8c70975dd build(deps): bump the patch group across 2 directories with 10 updates (#939) 2025-08-26 12:45:49 -04:00
dependabot[bot] 9ff3cffb59 build(deps): bump the patch group across 2 directories with 6 updates (#914) 2025-08-12 10:27:56 +00:00
Marc-André Lureau 03cac54ada build(deps): bump der-parser to 10.0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-07-24 06:34:50 -04:00
Marc-André Lureau b4fb0aa0c7 build(deps): bump thiserror to 2.0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-07-24 06:34:50 -04:00
Marc-André Lureau cb99c82c7d refactor(graphics): hand-implement Error trait
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-07-24 06:34:50 -04:00
Marc-André Lureau 83ad04dd56 refactor(cliprdr-format): hand-implement Error trait
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-07-24 06:34:50 -04:00
devolutionsbot a3255610d8 chore(release): prepare for publishing (#863) 2025-07-08 17:39:04 +00:00
devolutionsbot b09d46f8f2 chore(release): prepare for publishing (#860) 2025-07-08 12:42:46 +00:00
devolutionsbot ad64c83814 chore(release): prepare for publishing (#836) 2025-06-27 07:10:42 -04:00
dependabot[bot] e5f92ae11c build(deps): bump the patch group across 2 directories with 6 updates (#821) 2025-06-17 04:08:04 -04:00
devolutionsbot c09f9719e0 chore(release): prepare for publishing (#813) 2025-06-06 09:18:24 +00:00
devolutionsbot bca455f158 chore(release): prepare for publishing (#800) 2025-06-03 15:22:28 +00:00
Benoît Cortier 5e6e4e1627 chore(release): prepare ironrdp-core 0.1.5 (#795) 2025-05-27 12:25:54 -04:00
devolutionsbot aa6777b56a chore(release): prepare for publishing (#748) 2025-05-27 15:21:56 +00:00
dependabot[bot] 3029c8f909 build(deps): bump the patch group across 2 directories with 2 updates (#789) 2025-05-13 07:05:19 -04:00