Commit 5ae0568
react-native(fabric): native proof-of-delivery props elision (Stage 2)
The full serialized _uikitHostPropsJson rides on EVERY host lifecycle
crossing (NativeScriptUIView runUIKitHostLifecycle:transactionJson:)
and is re-marshalled through a JSI string copy on the worklet side
(NativeScriptNativeApiModule's createFromUtf8) even though the JS-side
memo (lastNativePropsJson, already landed) makes the *apply* a no-op
once JS has these exact bytes.
Adds _lastDeliveredUikitHostPropsJson: the props string last DELIVERED
where a crossing proved (via a non-nil handles return) that JS had a
live registration to memo it on. The per-crossing call now elides
props (sends nil) only when the current _uikitHostPropsJson is
byte-identical to that marker; JS already treats empty/missing props
as a pure no-op (syncUIKitHostPropsFromNative's typeof guard), so
elision is outcome-identical to today's JS-side memo hit.
Fail-open by construction: the marker is set only on a non-nil
(proof-of-delivery) handles return and is cleared on any other
outcome (create-miss, JS-side exception) so the very next crossing
resends unconditionally; it is also cleared on any -setHostId: change
(a fresh registration has no memo of its own), which covers
-prepareForRecycle since that routes through the hostId setter. No JS
changes needed.
Extends the structural node test with tripwires for the fail-open
reset points (setHostId clear, dealloc release) and the elision
predicate (byte comparison of the pending call, never a hostId-keyed
side cache).
Verified: itest --suite slide (pop-slide 9/10, edge-swipe-slide 5/5,
zero strands/rehost/bypass -- matches this session's established noise
floor, see the Stage 1 commit), --suite core (11/12, one borderline
MAIN_THREAD_STALL_STEADY jitter scenario, same pattern as pristine
baseline under load), --suite parity (14/14), --suite reveal (12/12 --
the cold-first create/replay windows this change touches), and the
plain-node structural tests (35/38, 3 pre-existing/unrelated).
Honest sizing (Stage 0, NS_NS_HOST_PROFILE): for this demo app's
crossings, native jsMs already tracked the JS-side "rest" bucket almost
exactly (e.g. 82.2ms vs 82.0ms), meaning the props-marshal gap this
stage targets was not separately measurable at this app's payload
sizes -- the design's hypothesis that this dominates the 250-370ms
burst did not hold here. Landed anyway per the design (cheap,
fail-open, protects larger payloads); the real remaining cost is
adapter-side reconcile/handler execution, out of scope (design doc
Sec 6.5/6.6).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent e1c7ab1 commit 5ae0568
2 files changed
Lines changed: 115 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1858 | 1858 | | |
1859 | 1859 | | |
1860 | 1860 | | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
1861 | 1872 | | |
1862 | 1873 | | |
1863 | 1874 | | |
| |||
1911 | 1922 | | |
1912 | 1923 | | |
1913 | 1924 | | |
| 1925 | + | |
1914 | 1926 | | |
1915 | 1927 | | |
1916 | 1928 | | |
| |||
2010 | 2022 | | |
2011 | 2023 | | |
2012 | 2024 | | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
2013 | 2032 | | |
2014 | 2033 | | |
2015 | 2034 | | |
| |||
2808 | 2827 | | |
2809 | 2828 | | |
2810 | 2829 | | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
2811 | 2846 | | |
2812 | 2847 | | |
2813 | | - | |
| 2848 | + | |
2814 | 2849 | | |
2815 | | - | |
| 2850 | + | |
2816 | 2851 | | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
2817 | 2869 | | |
2818 | 2870 | | |
2819 | 2871 | | |
| |||
Lines changed: 61 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
174 | 180 | | |
175 | | - | |
| 181 | + | |
176 | 182 | | |
177 | 183 | | |
178 | | - | |
| 184 | + | |
179 | 185 | | |
180 | 186 | | |
181 | 187 | | |
182 | 188 | | |
183 | 189 | | |
184 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
185 | 244 | | |
186 | 245 | | |
187 | 246 | | |
| |||
0 commit comments