Repository navigation
feat(rust): Port utf8, lexer, text-lookup, dstr and bmem to obs-util (lands #68) - #59
Conversation
52ea328 to
b67ffe0
Compare
|
Rebased onto master at 9ed43b9, which includes #82, #83, #87, #89, #97, #104 and #81. Conflicts resolved, keeping both sides:
Evidence on the final tree:
Mutation check (TDD evidence, because #68 had no RED commit). Each mutant was applied,
Every mutant was killed. |
|
Rebased again onto master at ef4391e, which brings in #98 (obs-hevc). There were two conflicts, and I kept both sides of each:
On the new head, |
b67ffe0 to
44b8ca5
Compare
|
Rebased onto master at 2c7ae54, which brings in #88 (profiler-snapshot). I kept both sides of the export list and of the oracle build.rs file list. The gate ran under the lock, with the source touches done inside it. lint, rust-test and tier2 pass: 37 of 37 tests with OFF and with ON, and exports are IDENTICAL (1752 symbols). The head is re-stamped. I repeated the mutation check on this head and every mutant was killed: dstr upper (6 failing tests), utf8 surrogate range (1), is_padding without \r (4), bmem ALIGNMENT=16 (6). |
44b8ca5 to
d78753f
Compare
…43) Phase 3 ports of libobs/util into the obs-util crate, each with a safe core, a C ABI shim, Tier 1 tests, a layout test where a struct crosses the ABI, and a proptest parity suite against the original C built as an oracle. ENABLE_RUST_LIBOBS=ON drops the matching C sources from libobs. - utf8: hidden and non-Windows only (Windows keeps the C utf8.c). - lexer.c: follows master's C, including the #48 strref ordering. - text-lookup: no longer crashes on an opening quote at end of line; the shim returns false for a NULL lookup. - dstr: follows master's #46/#47 fixes; strlist_split takes a NUL separator. Wide-char and printf helpers stay in dstr-libc.c. - bmem: Windows _aligned_* branch and the allocation counter. The oracle vendors uthash 2.3.0 (BSD-1-Clause) for text-lookup.c, since the Rust test runners have no uthash package. Refs #43 Rebased onto master after #61 (base), #66 (file-serializer) and #85 (real utf8.c in the oracle): the oracle's utf8.c/platform_conv_host.c now use oracle_* utf8 names so they no longer clash with the Rust shims; the dstr-conversion oracle test moved to obs-util and calls oracle_dstr_*; duplicate bcrash/os_fopen/bmemdup/os_*_ptr stand-ins were dropped in favour of master's base-variadic.c, file_serializer_host.c and platform_conv_host.c; utf8 shims are listed in rust-hidden.txt; the vendored uthash is excluded from clang-format. Rebased again onto master after #82/#83/#87/#97/#89/#98/#88/#105: oracle build.rs keeps video_fourcc.c/task.c and drops the direct util/utf8.c (oracle/utf8.c already compiles it under oracle_* names, which platform_conv_host.c and #82's file_serializer_host.c use). Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=58f2156a689831720a1e6ad9004041e400917579 secs=135 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791658556,"gate":"rust/all/fmt","host":"linux-x86_64","key":"e533312cff231c50944045005e90c2b48ce1920b317c9037a705bfda5b49ef4c","lane":"lint","parents":["930903b5e8c0cac6cec54edd05abeaacb825637c"],"secs":17,"stamp":"a33efc3cd6c98f3fbd2fa57e9a61a281","tree":"58f2156a689831720a1e6ad9004041e400917579","v":1,"via":"run"} Ci-Attestation: {"at":1791658556,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"e533312cff231c50944045005e90c2b48ce1920b317c9037a705bfda5b49ef4c","lane":"lint","parents":["930903b5e8c0cac6cec54edd05abeaacb825637c"],"secs":17,"stamp":"fb2d0a58bcefb05085a4b512fc916740","tree":"58f2156a689831720a1e6ad9004041e400917579","v":1,"via":"run"} Ci-Attestation: {"at":1791658556,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"1a00cb7a8eb7b67b33a108e748711133d604e544b254813435cc1ca5ea24cd26","lane":"rust-test","parents":["930903b5e8c0cac6cec54edd05abeaacb825637c"],"secs":22,"stamp":"d80b75173a27c995da2676193fa36904","tree":"58f2156a689831720a1e6ad9004041e400917579","v":1,"via":"run"} Ci-Attestation: {"at":1791658556,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"a950373231b455174e5c031fe578e1e48c61e04f0387195a7ddc0e265e371e15","lane":"tier2-linux","parents":["930903b5e8c0cac6cec54edd05abeaacb825637c"],"secs":96,"stamp":"f1c2d81609277e26492a5a3f3553cd9c","tree":"58f2156a689831720a1e6ad9004041e400917579","v":1,"via":"run"}
d78753f to
b90c14a
Compare
|
This PR now lands #68's port on master (#68 was merged into this branch, not master). It's rebased onto current master as two commits (dstr-libc.c extraction, then the port). Mutation check on this tree: dstr |
Since #59 landed the dstr port, the oracle's C-only dstr helpers are renamed to oracle_* in dstr_libc.c, so pipe.c's call to dstr_vprintf no longer resolved and pipe_parity failed to link. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=49f37a4bdc3a47a6673932771da06e38592795e1 secs=101 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791660091,"gate":"rust/all/fmt","host":"linux-x86_64","key":"76845a07b76b403e9e9c1dd244fe69e1483ff9014433913c959fe1429763ca42","lane":"lint","parents":["095499c364556f2275d99c8219371ab8c39b8663"],"secs":35,"stamp":"d1e57638b365370e3ebbc8f30453ebc1","tree":"49f37a4bdc3a47a6673932771da06e38592795e1","v":1,"via":"run"} Ci-Attestation: {"at":1791660091,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"76845a07b76b403e9e9c1dd244fe69e1483ff9014433913c959fe1429763ca42","lane":"lint","parents":["095499c364556f2275d99c8219371ab8c39b8663"],"secs":35,"stamp":"909036a7db1c4817cc44b41587a067f4","tree":"49f37a4bdc3a47a6673932771da06e38592795e1","v":1,"via":"run"} Ci-Attestation: {"at":1791660091,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"efa4047785515960cd5fcfeff586def0aa201be71a313b7a6798c0f8217b8de5","lane":"rust-test","parents":["095499c364556f2275d99c8219371ab8c39b8663"],"secs":22,"stamp":"df125eaed683ef1be8de1b0a9f62cc7a","tree":"49f37a4bdc3a47a6673932771da06e38592795e1","v":1,"via":"run"} Ci-Attestation: {"at":1791660091,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"73c68c21ad3186eb706eb887d474b3f8d0f624cf6309a43336ab4a88f4cb4c95","lane":"tier2-linux","parents":["095499c364556f2275d99c8219371ab8c39b8663"],"secs":44,"stamp":"da30fe11ae3202db7b9ffba7d926de15","tree":"49f37a4bdc3a47a6673932771da06e38592795e1","v":1,"via":"run"}
Since #59 landed the dstr port, the oracle's C-only dstr helpers are renamed to oracle_* in dstr_libc.c, so pipe.c's call to dstr_vprintf no longer resolved and pipe_parity failed to link. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=1feca72c20789abbb89791580cdb0d6d746091d3 secs=127 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791660722,"gate":"rust/all/fmt","host":"linux-x86_64","key":"7e33d005d800274406aabfad568fc4355c94ef47e5e2a0415f628b093bc2b22c","lane":"lint","parents":["fd9ed9e4393a492bf351521c5cf1610ec7cd8860"],"secs":47,"stamp":"3d357aa2dcd3cef0c6b8800e44d6edb9","tree":"1feca72c20789abbb89791580cdb0d6d746091d3","v":1,"via":"run"} Ci-Attestation: {"at":1791660722,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"7e33d005d800274406aabfad568fc4355c94ef47e5e2a0415f628b093bc2b22c","lane":"lint","parents":["fd9ed9e4393a492bf351521c5cf1610ec7cd8860"],"secs":47,"stamp":"c8254164df53398d569267971606c58e","tree":"1feca72c20789abbb89791580cdb0d6d746091d3","v":1,"via":"run"} Ci-Attestation: {"at":1791660722,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"a81df521538d00f57f5e1c8d90b5c8a52408e5e21ee642b48ea6fab80291c43b","lane":"rust-test","parents":["fd9ed9e4393a492bf351521c5cf1610ec7cd8860"],"secs":27,"stamp":"1e5dad10cdf39dc0c658a566bdf9f6e6","tree":"1feca72c20789abbb89791580cdb0d6d746091d3","v":1,"via":"run"} Ci-Attestation: {"at":1791660722,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"4a64da498f9cbfdb9fe79abbf81555054cecef871ad36e5165bd1ca9f9b82ed8","lane":"tier2-linux","parents":["fd9ed9e4393a492bf351521c5cf1610ec7cd8860"],"secs":53,"stamp":"1da11ade13b263bb075da985be911b60","tree":"1feca72c20789abbb89791580cdb0d6d746091d3","v":1,"via":"run"}
…racle After rebasing onto the dstr/utf8/bmem port (#59), the config-file oracle defined a second os_fread_utf8 (also in test_stubs.c, which is faithful to platform.c and returns 0 where this copy returned the size) and called dstr_printf, which the oracle now provides only as oracle_dstr_printf. Drop the duplicate and map dstr_printf. Also drop the second vendored uthash.h; the oracle already vendors the identical v2.3.0 header. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=ef51922f491a4fe263185dc1da2378b22a8b8dad secs=122 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791663729,"gate":"rust/all/fmt","host":"linux-x86_64","key":"3d995bbf6c67895f6671a6f6fc11e865076044218ad98830103f697e65d4e650","lane":"lint","parents":["7527727eb95c00ed71c159c3e2e1c7f86ef9e1e5"],"secs":36,"stamp":"c575d8d07689e72a90d4171fa2697360","tree":"ef51922f491a4fe263185dc1da2378b22a8b8dad","v":1,"via":"run"} Ci-Attestation: {"at":1791663729,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"3d995bbf6c67895f6671a6f6fc11e865076044218ad98830103f697e65d4e650","lane":"lint","parents":["7527727eb95c00ed71c159c3e2e1c7f86ef9e1e5"],"secs":36,"stamp":"869a6d8d1f196354c46bd557fc50e48c","tree":"ef51922f491a4fe263185dc1da2378b22a8b8dad","v":1,"via":"run"} Ci-Attestation: {"at":1791663729,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"26a01ce11566f855f04267b0ffe9f56b8fc971fd5d474b414647ea8de3339ae3","lane":"rust-test","parents":["7527727eb95c00ed71c159c3e2e1c7f86ef9e1e5"],"secs":28,"stamp":"32e302c2650a1ca783b70871b606bdba","tree":"ef51922f491a4fe263185dc1da2378b22a8b8dad","v":1,"via":"run"} Ci-Attestation: {"at":1791663729,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"ba570743c5bfee732fff75a44b04461a8dec0b0b227b5881d915ac71e00c0957","lane":"tier2-linux","parents":["7527727eb95c00ed71c159c3e2e1c7f86ef9e1e5"],"secs":58,"stamp":"91d2fa8e6981d011391c50ad6ff4586b","tree":"ef51922f491a4fe263185dc1da2378b22a8b8dad","v":1,"via":"run"}
Lands the port from #68, which was merged by mistake into
grind/meta-4-c7d3instead of master.This branch is now just #68's two commits rebased linearly onto current master:
libobs/util: Move wide-char and libc-backed dstr helpers into dstr-libc.cfeat(rust): Port utf8, lexer, text-lookup, dstr and bmem to obs-util (#43)The empty
grind: start feature branchcommits and the old master merges were dropped.Refs #43. After this merges, #49 has to drop its lexer commits.