Skip to content

Austin Oxidation

Nicholas Nethercote edited this page Dec 18, 2017 · 6 revisions

Intro

  • Phase 1 of Oxidation was mostly about fixing hard blocks so Rust could ship
  • Phase 2 is about making it easier and smoother to use Rust in Firefox

Oxidation wiki page

  • Any problems, changes required?
  • Contact njn if you have comments later

Work in progress

  • ttromey: Better debugging
    • We currently pretend Rust is C++, which means some language features can't be debugged well
  • mw: incremental compilation
    • Available in Rust 1.24?
  • mystor: XPCOM bindings, nsTArray bindings
    • underway
  • In Q1 2018 a contractor will be adding distributed compilation to sccache
  • jwatt: exploring using imglib from Piston
    • Requires full image data to be available before parsing? Would be a problem for Firefox
  • aturon: Looking at stabilizing SIMD
  • emilio: adding indexing of Rust code to Searchfox
  • (someone): Making enum layout stable enough to use from C++
  • gps(?): Looking at how to handle minor edits of crates vendored into mozilla-central
  • Manish: investigating insufficient codegen unit use in large crates
  • Too many copies of things investigated by a consultant
  • njn: will evaluate perf of Rust vectors and hash tables against Gecko's in Q1 2018 (bug 1425770)

Prioritize significant blockers remaining

(All meeting attendees were invited to extend an initial list of items, and then cast a vote for two items on the final list. Sub-bullet points capture additional discussion about each item.)

  • 16 votes: Compile speed and memory usage
    • sccache-icecream: contractor starting Q1, hopefully distributed rust compilation
      • Doesn't help remotees without multiple machines and/or fast internets
    • Cross-compile on win64 for win32?
  • 7 votes: Cross-language inlining (making using Rust at fine grain from C++ not hurt optimizations)
    • ThinLTO / LTO with C++ code
    • Needs clang-cl on windows
    • ajones had a discussion about that. Must be link time because there are two separate compilers. Have had to double-implement to get inlining. Need to find a resource to get rustc to write sufficient information for llvm lto to do that. Also requires using clang for C++. acrichto: Linker's LTO plugin needs to be newer than the one in clang and rustc, and then it should work.
  • 4 votes: rust-bindgen shortcomings (C++ -> Rust bindings)
    • Maybe blocked on refactoring style?
  • 3 votes: Better debugging
  • 3 votes: XPCOM bindings
    • CC through Rust types? (native + XPCOM)
  • 3 votes: Ability to edit vendored crates in Gecko.
  • 2 votes: Android is not Tier1 for Rust
  • 2 votes: WebIDL binding generation
    • Requires hooking up the Rust stuff to Gecko's memory management?
  • 2 votes: Infra: do we still have to keep Servo tree green? If so, need infra spend
  • 2 votes: IDE/symbol lookup support
  • 2 votes: Cargo improvements for build scripts, build system integration, separate optimization levels for dependent crates
  • 2 votes: Improve documentation on how to partially port code in m-c: https://firefox-source-docs.mozilla.org/build/buildsystem/rust.html
  • 2 votes: reduce Rust code size
    • Stylo-related code size issues: https://bugzilla.mozilla.org/showdependencytree.cgi?id=1328497&hide_resolved=1
    • bug 1375222: Lots of 48-byte stack locals being copied in style::properties::PropertyDeclaration::parse_into
    • bug 1375225: Redundant object copies in style::properties::PropertyDeclaration::parse_into
    • bug 1375234: Repetitive code in style::properties::PropertyDeclaration::parse_into
    • bug 1369420: Identical failure paths should be collapsed
  • 1 vote: Fix things preventing SpiderMonkey from having Rust dependencies
  • 1 vote: IPDL binding generation
    • Changes to IPC infrastructure are being discussed; if there are things we can do to make Rust integration easier….
  • 1 vote: cbindgen shortcomings
  • 1 vote: SIMD stabilization
  • 0 votes: Too many copies of things in generated code
  • 0 votes: host binaries that can be run at build time
  • 0 votes: Crash reporting improvements?: https://bugzilla.mozilla.org/show_bug.cgi?id=1348896
  • 0 votes: Code coverage?
  • 0 votes: Profiling improvements? Especially for parallel code.
    • The Gecko Profiler can't demangle rust symbols
    • There's a crate we can hook up for this
  • 0 votes: Test integration?
  • 0 votes: manish: Multiple bindgen invocations ?
    • Currently each run is expensive, and we only run it once for stylo.
    • emilio: Would be nice to have central gecko bindings everyone can participate in.
    • manish: some advantages to having bindgen all in one crate.
    • emilio: Stylo changes planned to make it easier to split out bindings.
    • Compile bindgen as opt is worth it? compile time vs runtime trade-off in build time.
    • mw: Sounds like a good opportunity to enable ThinLTO for compiling bindgen
    • manish: probably will write RFC for dependency specific profiles
  • 0 votes: Fallible allocation?
    • We currently have hacky work-arounds: fallible re-implementations of Vec and HashMap

Training

  • njn is investigating possibility of getting ~300 copies of Jim and Jason's O'Reilly book to distribute to engineers
  • Prior trainings have happened in the Paris and Toronto officies
  • We have instructors available to run courses and resources
  • We have lots of training budget that is rarely utilized
  • We have lots of early adoptors who know Rust. Need to address the people who haven't had time, or don't really want to.
  • mystor: Have an easy-to-find list of people who you can ask to review rust code alongside a module peer if they don't know it?
    • "Rust peers"
  • Need to 'say it louder' - enable management to make training opportunities available.
    • dcamp during Firefox plenary: "if it makes sense to write something in Rust, a lack of an engineer who knows Rust shouldn't be an excuse" (approximate quotation)
  • ajones: Ultimately, we want to ship more features, and Rust is a way to do that, so each team needs to make a trade-off between investment in learning and rewrite and being able to ship code.
  • Venue selection is important. People don't want to travel, or people in one region need localized training, specific skill level. This affects planning.
  • Some data would be good. What level of Rust experience do contributors have, particularly C++ devs at Mozilla?
    • Some kind of survey to find out?
  • bz: Review is different from writing. How to find correct API documentation for crate versions in m-c?
  • manish: Lots of training/docs are heavy on the borrow checker, but that tends to be less surprising for Gecko C++ developers, so should de-emphasize that
  • jrmuizel: Need guidelines for unsafe code
    • Rust team is documenting undefined behaviour
    • But this is lower priority than build times, which is what Firefox wants
Clone this wiki locally