August 14th, 2024

Re-fixing Servo's event-loop

Servo's event-loop improvements aim to resolve a concurrency issue with rendering updates by scoping task batching per page. TLA+ is recommended for verification, but intermittent test failures persist.

Read original articleLink Icon
Re-fixing Servo's event-loop

The article discusses ongoing improvements to Servo's event-loop, focusing on addressing a concurrency issue that arose during the implementation of rendering updates. The initial approach involved batching rendering tasks using a boolean flag, which led to problems when a web page was closed, causing tasks for other documents to be indefinitely delayed. The proposed solution is to scope the batching of tasks per page, which would prevent the cancellation of tasks for other documents when one page closes. The author emphasizes the importance of establishing a logical invariant to ensure that the system behaves correctly, suggesting the use of TLA+ for modeling and verifying the system's behavior. The article also highlights the challenges of formal verification and the need for human judgment in linking the model to the actual code. Despite the proposed fixes, the author notes that intermittent test failures continue to occur, indicating that further investigation is needed to determine whether the batching issue has been resolved or if other factors are at play.

- Servo's event-loop is undergoing renovations to improve rendering updates.

- A concurrency issue was identified with the initial task batching approach.

- The proposed fix involves scoping task batching per page to avoid task cancellation.

- TLA+ is suggested for modeling and verifying system behavior.

- Intermittent test failures indicate that further investigation is required.

Related

Eight million pixels and counting: improving texture atlas allocation in Firefox (2021)

Eight million pixels and counting: improving texture atlas allocation in Firefox (2021)

Improving texture atlas allocation in WebRender with the guillotiere crate reduces texture memory usage. The guillotine algorithm was replaced due to fragmentation issues, leading to a more efficient allocator. Visualizing the atlas in SVG aids debugging. Rust's simplicity and Cargo fuzz testing are praised for code development and robustness. Enhancements in draw call batching and texture upload aim to boost performance on low-end Intel GPUs by optimizing texture atlases.

Four lines of code it was four lines of code

Four lines of code it was four lines of code

The programmer resolved a CPU utilization issue by removing unnecessary Unix domain socket code from a TCP and TLS service handler. This debugging process emphasized meticulous code review and system interaction understanding.

The Process That Kept Dying: A memory leak murder mystery (node)

The Process That Kept Dying: A memory leak murder mystery (node)

An investigation into a recurring 502 Bad Gateway error on a crowdfunding site revealed a memory leak caused by Moment.js. Updating the library resolved the issue, highlighting debugging challenges.

Servo Web Engine Now Leverages Multiple CPU Cores for Rendering HTML Tables

Servo Web Engine Now Leverages Multiple CPU Cores for Rendering HTML Tables

The Servo project announced advancements in its web layout engine, including a parallel table layout mode, improved flexbox support, and new web features, enhancing performance and functionality as an open-source engine.

This month in Servo: console logging, parallel tables, OpenXR, and more

This month in Servo: console logging, parallel tables, OpenXR, and more

In July 2024, Servo launched new features for its web rendering engine, including console logging in Firefox devtools, parallel table layout, and an OpenXR backend, while also enhancing documentation and financial support.

Link Icon 4 comments
By @bsaul - 5 months
I'm so glad the industry starts adopting formal proofs more and more... After 20 years in the industry i still feel like a caveman, coding as best as i can, hoping nothing bad will happen (and then sighing at the sight of the 100ks line counts of my project).

Maybe having more powerful code generators like LLMs will shift us toward spending more time on specification and modelling ? Let's hope so.

By @aumerle - 5 months
The end of the article says the bug isn't fixed, so presumably, the root cause identification was wrong?
By @baq - 5 months
Didn't expect to find a TLA spec here! Criminally underused tool in our industry.
By @proneb1rd - 5 months
This is how medium blogs look like. I can’t believe people still post there https://imgur.com/a/2PpS14h