You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 24, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 24, 2023. It is now read-only.
In light of the interop concerns in allowing an implementation-defined page size for rounding maxByteLength, I've come around back to removing the ability to observably round.
I find the interoperability and fingerprinting pushbacks reasonable, but if we address those concerns by fixing the page length, that makes the rounding support much less useful for engines. The original motivation was that the engine might want to round to a page-multiple anyway, and why track a separate length for what the real memory reservation is, which would complicate the implementation. If we fix a page length, the engine might still want to round to a page-multiple for its own page size, which then requires tracking a separate length again.
Since we aren't forcing implementations to round, I think fixing a page size doesn't make sense and would only make the rounding an extra complexity. So I'd like for us to go back to not having any observable rounding behavior at all. Thoughts?
I need to check with the broader team, but I think this is fine -- it would involve rounding within the implementation and tracking the intended size -- throwing if we get beyond that. It might be a bit annoying but that would be doable and not be as risky as implementation defined rounding.
Most people are out for the next few days, i will get back to you with a concrete answer on tuesday.
Just to refresh my memory/clarify, you’re proposing that if the byte length is not a multiple of the page size the engine handles that internally?
If so, that sounds fine. My only thoughts are that it might be nice to provide JS uses the same VM based bounds checking behavior we provide for Wasm memories. I wouldn’t be too surprised if being able to skip the explicit bounds check is a few percentage point improvement. I also wouldn’t be surprised if there was no difference though.
Perhaps we could make that easier by providing a pageSize static property on the constructor. This could be a multiple of the true page size of fingerprinting is a concern, although I think it wouldn’t be hard to find the true page size with timing so that may not matter really.
That said, since at least for JSC, VM based bounds checked Wasm memories are somewhat limited, so perhaps something getting a VM bounds checked ArrayBuffer should be an option passed to the constructor? It might also make sense in the passed option world to force the any byteLength to be a multiple of 64k (matching Wasm).
Just to refresh my memory/clarify, you’re proposing that if the byte length is not a multiple of the page size the engine handles that internally?
Yes, exactly.
If so, that sounds fine. My only thoughts are that it might be nice to provide JS uses the same VM based bounds checking behavior we provide for Wasm memories.
You can still do that, it's just that if the engine actually reserves a page-multiple size of virtual memory, it'd need to track that reservation internally with an additional length, since it won't be observable to user code.
Activity
syg commentedon Apr 1, 2021
Forgot to cc @marjakh.
codehag commentedon Apr 2, 2021
I need to check with the broader team, but I think this is fine -- it would involve rounding within the implementation and tracking the intended size -- throwing if we get beyond that. It might be a bit annoying but that would be doable and not be as risky as implementation defined rounding.
Most people are out for the next few days, i will get back to you with a concrete answer on tuesday.
kmiller68 commentedon Apr 3, 2021
Just to refresh my memory/clarify, you’re proposing that if the byte length is not a multiple of the page size the engine handles that internally?
If so, that sounds fine. My only thoughts are that it might be nice to provide JS uses the same VM based bounds checking behavior we provide for Wasm memories. I wouldn’t be too surprised if being able to skip the explicit bounds check is a few percentage point improvement. I also wouldn’t be surprised if there was no difference though.
Perhaps we could make that easier by providing a pageSize static property on the constructor. This could be a multiple of the true page size of fingerprinting is a concern, although I think it wouldn’t be hard to find the true page size with timing so that may not matter really.
That said, since at least for JSC, VM based bounds checked Wasm memories are somewhat limited, so perhaps something getting a VM bounds checked ArrayBuffer should be an option passed to the constructor? It might also make sense in the passed option world to force the any byteLength to be a multiple of 64k (matching Wasm).
syg commentedon Apr 8, 2021
Yes, exactly.
You can still do that, it's just that if the engine actually reserves a page-multiple size of virtual memory, it'd need to track that reservation internally with an additional length, since it won't be observable to user code.
Revert "Allow implementations to round up max byte lengths (#25)"
syg commentedon Apr 13, 2021
@codehag ping for Mozilla's thoughts here.
codehag commentedon Apr 14, 2021
On it, will have them tomorrow (likely the above comment. I spoke to a few people but we didn't fully discuss yet)
codehag commentedon Apr 19, 2021
Forgot to write here: Thoughts are what I outlined above -> we are fine with this change and prefer it to the implementation defined behavior
syg commentedon Apr 19, 2021
Great, thank you!