Live data from Hacker News

SerenityOS Browser now passes the Acid3 test

twitter.com

151–160 of 178 posts

Re: SerenityOS Browser now passes the Acid3 test

#151
post #147

Earlier quoted context omitted.

The lowest bound would be the size of the texture the page is rendered into, no ? If you're on a 4k screen an uncompressed rgba pixmap is already 31MB... And that's really just the raw pixel storage which needs to be associated with your process

You don't have to render the whole page to a pixmap at once; it's very reasonable for a display-list representation of the page using a font atlas to be a tiny fraction of that size, maybe 8 bytes per character, and a GPU shader can render the RGBA pixmap from a spatially partitioned display list on demand. 2144 characters of text on my 1920×1080 display extrapolates to 17152 characters on a 4K display, which would b…

> and a GPU shader can render the RGBA pixmap from a spatially partitioned display list on demand.

... but... the GPU shader will need a surface to render into, no ? do you know of any OS where asking for a 1000x1000 surface does not allocate space for that in normal, non-GPU RAM ? I believe that this uses RAM on any mainstream desktop OS

Re: SerenityOS Browser now passes the Acid3 test

#152
post #147

Earlier quoted context omitted.

You don't have to render the whole page to a pixmap at once; it's very reasonable for a display-list representation of the page using a font atlas to be a tiny fraction of that size, maybe 8 bytes per character, and a GPU shader can render the RGBA pixmap from a spatially partitioned display list on demand. 2144 characters of text on my 1920×1080 display extrapolates to 17152 characters on a 4K display, which would b…

> and a GPU shader can render the RGBA pixmap from a spatially partitioned display list on demand. ... but... the GPU shader will need a surface to render into, no ? do you know of any OS where asking for a 1000x1000 surface does not allocate space for that in normal, non-GPU RAM ? I believe that this uses RAM on any mainstream desktop OS

The GPU shader could in theory be rendering into a tile that gets squirted out to the screen by the RAMDACs and then reused, but I think you're right that in practice the GPU has at least one full-screen framebuffer, usually two or, dismayingly, three. Often the monitor has an additional two or three!

I'm not sure it's fair to charge that framebuffer to the browser, though. The windowing system needs to use the same 31MB before you start the browser up, after all.

I don't know the answer to your question about mainstream desktop OSes and space allocation for shaders for windows that aren't being displayed. Maybe someone who knows more than you or me can chime in.

Re: SerenityOS Browser now passes the Acid3 test

#153
post #146

Earlier quoted context omitted.

That last part sounds interesting. Can you elaborate?

DOM nodes are mutable and have parent pointers, so there's no way to share structure between duplicated parts of the element tree; JS might mutate them to no longer be duplicates. NodeLists like the .childNodes property (but not the results of, say, .querySelectorAll) are required to be "live", magically updating when you change the document; this code produces 1 even though there's no explicit mutation of c: let d =…

I missed the editing window, but here's a simple example of ElementTree in Python; consider what it would take to do this in JS with the DOM if you had to implement .innerText yourself:

    >>> from xml.etree import ElementTree
    >>> def text(e):
    ...     return (e.text or '') + ''.join(
                text(kid) for kid in e.getchildren()) + (e.tail or '')
    ... 
    >>> text(ElementTree.fromstring('

My Malamute is really hairy.

')) 'My Malamute is really hairy.'
Or if you had to implement .querySelectorAll yourself:

    >>> def find(e, clase):
    ...  if e.get('class') == clase: yield e
    ...  for kid in e.getchildren():
    ...   for nieto in find(kid, clase): yield nieto
    ... 
    >>> list(find(ElementTree.fromstring('

My Malamute is really hairy.

'), 'dog')) []
In Python the .getchildren() call is unnecessary because ElementTree elements implement Python's iteration protocol, but I thought that might obscure the point a little.

On the other hand, without the dopey None case I objected to above, you wouldn't need the "or ''".

Re: SerenityOS Browser now passes the Acid3 test

#154

Earlier quoted context omitted.

>but rather the fact that there are hundreds of independent development processes, each controlling a small fraction of the whole system. Doing any kind of cross-subsystem work in that environment becomes a significant undertaking Hi Andreas, hope you are doing well. This is very wrong. There are a lot of distributions of Linux and BSD that try very hard to ship as one cohesive system. Your issue doesn't make any sen…

Please point me to one of these Linux systems where the kernel, drivers, windowing system, GUI framework, networking libraries, image format decoders, font rasterizers and all CLI and GUI applications plus the libraries that support them are developed cohesively within a single project and not assembled from 3rd party sources.

Even Windows and OSX borrow code from Freetype and such.

Windows had an embedded Prolog interpreter for the network settings, a TCP/IP stack borrowed from BSD, and so on.

Then, with OSX... multiply that for 200.

On Harfbuzz: https://wikiless.org/wiki/HarfBuzz?lang=en

Re: SerenityOS Browser now passes the Acid3 test

#155
post #152

Earlier quoted context omitted.

> and a GPU shader can render the RGBA pixmap from a spatially partitioned display list on demand. ... but... the GPU shader will need a surface to render into, no ? do you know of any OS where asking for a 1000x1000 surface does not allocate space for that in normal, non-GPU RAM ? I believe that this uses RAM on any mainstream desktop OS

The GPU shader could in theory be rendering into a tile that gets squirted out to the screen by the RAMDACs and then reused, but I think you're right that in practice the GPU has at least one full-screen framebuffer, usually two or, dismayingly, three. Often the monitor has an additional two or three! I'm not sure it's fair to charge that framebuffer to the browser, though. The windowing system needs to use the same…

> The windowing system needs to use the same 31MB before you start the browser up, after all.

every process needs its own surface for compositing though. If you open 200 4k windows you'll get 200*31MB, they aren't going to share the memory with the desktop one

Re: SerenityOS Browser now passes the Acid3 test

#156
post #152

Earlier quoted context omitted.

The GPU shader could in theory be rendering into a tile that gets squirted out to the screen by the RAMDACs and then reused, but I think you're right that in practice the GPU has at least one full-screen framebuffer, usually two or, dismayingly, three. Often the monitor has an additional two or three! I'm not sure it's fair to charge that framebuffer to the browser, though. The windowing system needs to use the same…

> The windowing system needs to use the same 31MB before you start the browser up, after all. every process needs its own surface for compositing though. If you open 200 4k windows you'll get 200*31MB, they aren't going to share the memory with the desktop one

That's definitely one way to do it, and now that you mention it I do know that there are definitely things that do it that way, but it might not be a good one. Windows that aren't visible don't need their output surface to be materialized, and introducing a compositing step after your 4k window renders adds an extra 11 gigabytes per second of memory bandwidth at 120fps, and probably a few precious milliseconds of latency. In the limit of inexpensive rendering — which alpha-blending a few thousand rects from a font atlas might approach — it doubles the battery drain needed to redraw the screen.

Re: SerenityOS Browser now passes the Acid3 test

#157

Earlier quoted context omitted.

Feels like this might be an example of "worse is better". Or alternately, that the community that SerenityOS has built and the joy they find in tinkering matters more than their technical foundations, in terms of getting something built that works and is maintained/maintainable. Servo looks like it could have been a technically better browser engine, but it seems the window for it becoming relevant is closing, while…

I agree with you about the project being a joy for the developers. But as a user, in no way I would rely on a browser started in 2020 written in c++ (or in zig, given other comments about its security characteristics). Keep in mind that gecko/webkit were written initially in c++ because c++ was the best language available at the time for these projects. This is not true anymore.

Webkit is still C++, and with its market share slowly reaching zero (now at about 3%), the 10% of Rust code in Gecko hardly matter.

Re: SerenityOS Browser now passes the Acid3 test

#159

Earlier quoted context omitted.

This, absolutely. Especially if it comes with a GUI in the same aesthetics as SerenityOS itself. The world needs less Chrome-clones and Google-backed browsers (which to a certain extent includes Firefox), and more independent ones. As someone who has also been attempting to write a browser (engine) in my spare time --- but these guys are far ahead of me --- this is great to see.

The problem is: who's gonna use it? Sure, it's good to have more options but, the deploy base of browsers like Chrome are massive and IE6 only lost its position by being careless and stop evolving (and lets not forget it took years), which is something that is not happening with Chrome. Just to make clear, this is not specifically directed to you or your project, which is a great thing to do independently of the outc…

Having a lightweight embeddable browser engine (or even html parser) to use in your projects to display hypertext would be nice.

Re: SerenityOS Browser now passes the Acid3 test

#160

Earlier quoted context omitted.

This, absolutely. Especially if it comes with a GUI in the same aesthetics as SerenityOS itself. The world needs less Chrome-clones and Google-backed browsers (which to a certain extent includes Firefox), and more independent ones. As someone who has also been attempting to write a browser (engine) in my spare time --- but these guys are far ahead of me --- this is great to see.

The problem is: who's gonna use it? Sure, it's good to have more options but, the deploy base of browsers like Chrome are massive and IE6 only lost its position by being careless and stop evolving (and lets not forget it took years), which is something that is not happening with Chrome. Just to make clear, this is not specifically directed to you or your project, which is a great thing to do independently of the outc…

I think browsers are comparable to operating systems, and if we look at the richness of the Linux ecosystem, I'd say it can't hurt to have a few more browsers and browser engines. For example, most users wouldn't see the utility of Arch linux. And yet Arch linux is the backbone of Docker. Perhaps a new browser engine can fill a similar niche, targeting low resource usage and light browsing
Post reply on HN