-
ajeffrey
I find the types useful most of the time, for avoiding stupid wrong-coordinate-space errors, but I can imagine cases like getPose where they'd be annoying.
-
Manishearth
ajeffrey: the problem is they're too specific
-
Manishearth
we need ways to downcast them to the right specificity
-
Manishearth
i have a hack
-
Manishearth
i can't *store* generic types
-
Manishearth
it's all runtime
-
Manishearth
eg. i have no way of generically working with
doc.servo.org/webxr_api/enum.Views.html while keeping the runtime view information
-
ajeffrey
Manishearth: yes, we might end up having to sprinkle functions around which forgets type information, and if we end up using those everywhere then we may as well not have bothered.
-
Manishearth
ajeffrey: origin offsets mess this up really badly, too, since it's a kinda sharp corner of the API that relates the native and effective origin
-
Manishearth
which is just confusing
-
Manishearth
like, i'm able to even introduce the concept of a viewer space but the origin offset messes with it
-
Manishearth
ajeffrey: take a look at the last WIP commit in my PR
-
Manishearth
ugh nope
-
Manishearth
ajeffrey: can we just get rid of the types completely and add them back in later?
-
Manishearth
this is becoming way too much
-
Manishearth
i thought i'd be able to reduce it to a smaller number of spaces but it doesn't work that way either
-
ajeffrey
Manishearth: looking...
-
Manishearth
ajeffrey: alternatively, some helpers making it easy to cast
-
Manishearth
idk
-
Manishearth
like, i kinda want the native/api distinction
-
Manishearth
i think for now this hack is good enough
-
Manishearth
lets me make progress
-
ajeffrey
Manishearth: should we just use untyped Euclid where you're using ApiSpace?
-
Manishearth
ajeffrey: we could
-
Manishearth
for now i'm not
-
Manishearth
in case i want to introduce more distinctions
-
Manishearth
e.g. Viewer would be an okay space to reintroduce *except* originoffset exists
-
Manishearth
i might end up doing that
-
Manishearth
for now i'm going to use a separate space so i can change things easily
-
Manishearth
i think i have a way to make use of Viewer
-
Manishearth
for this we need euclid to provide easy casting
-
Manishearth
basically if i model originOffset as a native to native transform it can work
-
Manishearth
ajeffrey: oh, also, all the f32s should be f64. we should change this later
-
Manishearth
actually maybe not
-
ajeffrey
Hmm, is it worth introducing a space Custom for cases where the user has specified an originOffset?
-
ajeffrey
so the originOffset would be a native-to-custom transform?
-
Manishearth
could be
-
ajeffrey
(name not great though)
-
Manishearth
the distinction is almost zero though
-
Manishearth
origin offsets show up in one place, it's not worth having that
-
ajeffrey
would allow keeping track of which APIs were in native coords, and which were in native-after-applying-offset.
-
ajeffrey
I used f32s just because that's what rust-webvr had.
-
Manishearth
hmm
-
Manishearth
okay
-
ajeffrey
also we might be able to SIMD the f32 versions if we ever wanted to use PF's geometry.
-
Manishearth
i think DOMPoint uses f64 but we don't have to
-
ajeffrey
but I don't have a strong opinion.
-
Manishearth
close to having it compiling
-
Manishearth
yep i think i should be able to reintroduce Viewer
-
Manishearth
it compiles, except for input
-
Manishearth
ajeffrey: are you working on mocking? 'cos I can piggyback input on that
-
Manishearth
eh, might as well add it to my fork for now
-
Manishearth
without mocking
-
ajeffrey
Manishearth: I think that's going to be tomorrow's job.
-
Manishearth
ajeffrey: sounds good
-
Manishearth
i will do input stuff tomorrow
-
Manishearth
ajeffrey: my PR is not landable yet, but ready for review. i may have a better solution for the origin offset stuff
-
Manishearth
standups: hook webxr crate into script:
servo/servo #23731
-
crowbot
PR #23731: [WIP] Use new WebXR API in script -
servo/servo #23731
-
crowbot
Status submitted successfully.
-
Manishearth
also i need to actually test this lol
-
Manishearth
but i can't on my laptop
-
ajeffrey
Manishearth: welcome to my world
-
ajeffrey
I've been working on webxr without being able to test it, gulp.
-
Manishearth
hey, at least glwindow works for you!
-
Manishearth
i can't test anything webxry on my machine because servo can't use webgl bc wayland
-
Manishearth
i should look into ixing that
-
Manishearth
fixing
-
Manishearth
ajeffrey: also probably should start reviewing . we can't land till input and mocking is sorted, but the stuff so far is self contained
-
ajeffrey
Manishearth: okay if that's another job for tomorrow?
-
Manishearth
ajeffrey: oh of course
-
ajeffrey
Manishearth: np
-
Manishearth
i'm not asking you to do anything today lol
-
Manishearth
to be clear
-
ajeffrey
yay for it being 9 at night :)
-
Manishearth
just trying to understand your priorities for tomorrow and the rest of the week so i can plan accordingly
-
Manishearth
okay there's not much benefit to separating out the viewer pose
-
Manishearth
er, viewer space
-
Manishearth
ajeffrey: View.transform should probably be inverted
-
Manishearth
the transfrom from viewer space to eye space isn't as useful as the pose of the eye space in viewer space (there are opposite)
-
Manishearth
hmm, got it working
-
Manishearth
it also found a bug, i think
-
Manishearth
yep
-
ajeffrey
Manishearth: not too surprised, that's what happens when code can't be tested!
-
taskcluster
Task "Servo daily: Linux x64: with Rust Nightly. On failure, ping: SimonSapin, nox, emilio" complete with status 'failed'. Inspect:
tools.taskcluster.net/tasks/CR15913nTVKXLOekQs4qLQ
-
jdm
crowbot: explain webxr
-
crowbot
jdm a picture is worth a thousand words:
i.imgur.com/tUs6hU7.png
-
jdm
holy crap
-
jdm
that's almost a real diagram
-
SimonSapin
standups:
rust-lang/rust #62528 Add joining slices of slices with a slice separator, not just a single item
-
crowbot
PR #62528: Add joining slices of slices with a slice separator, not just a single item -
rust-lang/rust #62528
-
crowbot
Status submitted successfully.
-
cybai
wow the webxr diagram is so cool!
-
ajeffrey
oh *that*'s what webxr is!
-
SimonSapin
standups:
rust-lang/rust #62530 Account for coercions in trait resolution?
-
crowbot
Issue #62530: Account for coercions in trait resolution? -
rust-lang/rust #62530
-
crowbot
Status submitted successfully.
-
cybai
jdm: around ๐?
-
jdm
crowbot: yep!
-
cybai
ha!
-
cybai
jdm: I'd like to ask, I'm trying to figure out how to load cyclic module records and I saw Gecko did it after loading top level module at
searchfox.org/mozilla-central/sourc…m/script/ScriptLoader.cpp#1271-1274. what do you think the equivalent behavior in Servo? ๐ค Should I do it inside `process_response_eof`?
-
jdm
cybai: if you stored some kind of handle in the module map for pending requests, then process_response_eof could resolve all of them
-
cybai
jdm: could you elaborate more? ๐โโ๏ธ do you mean saving kind of functions in the module map and execute them in process_response_eof? I think fetching descendants should be executed before doing those like `document.asap_script_loaded`
-
jdm
cybai: I mean storing _something_ which will end up triggering the appropriate promise job for each duplicate request. maybe that means storing Promise values?
-
jdm
cybai: so ModuleObject::Fetching could be something like ModuleObject::Fetching(Vec<Rc<Promise>>)
-
jdm
cybai: oh, I guess it's a bit different than what I imagined when I look at fetch_single_module_script
-
cybai
jdm: hmm, yeah ๐ค because we must do the first fetch and see the module record if it includes any other modules, maybe we can't store something like ModuleObject::Fetching(Vec<Rc<Promise>>) ๐?
-
ajeffrey
-
jdm
cybai: the goal here is that ModuleObject::Fetching stores whatever is necessary to notify any cyclic requests that are waiting on a result
-
ajeffrey
-
cybai
jdm: oh!! I see! I think I got your point. Let me think about how to do it! Thanks!
-
jdm
:)
-
jdm
standups: looking into supporting debugmozjs on windows.
-
crowbot
Status submitted successfully.
-
BitBot
[GitHub] (servo/servo) [PR] servo-wpt-sync requested #23732 merge into master: Sync WPT with upstream (09-07-2019) -
git.io/fjiNE
-
» cybai is so busy at work recently and he hopes he can do more work on module scripts ASAP ๐
-
lqd
cybai: btw ๐ on the recent playground PR (and all the ones before that ๐) :D
-
cybai
lqd: ha, that's an easy one I can do during busy time ๐
-
cybai
thanks!
-
lqd
:)
-
BitBot
[GitHub] (servo/webrender) [PR] jdm requested #3696 merge into master: Workaround bugs in old ANGLE versions. -
git.io/fjiAR
-
jdm
amazing, a month since the webrender upgrade started and there have been no breaking changes in the webrender APIs
-
eijebong
jdm: Nice
-
eijebong
How is the upgrade going ?
-
jdm
eijebong: waiting on a WPT sync to finish merging and the PR I just opened to be merged upstream
-
jdm
otherwise ready to go
-
eijebong
Nice
-
ajeffrey
I wonder how much work it would be to introduce serializable tasks to script?
-
ajeffrey
-
ajeffrey
with typetag we could have a TaskBox that is serializable too.
-
ajeffrey
that would allow us to avoid using ROUTER, and save on context switches.
-
jdm
fun fact: if you have a rust-lang/rust clone that you last pushed to in 2012 and there have been ~84k commits since, the git push operation is pretty slow
-
jdm
only required pushing 351mb upstream, however
-
jdm
standups: created PRs for rustc and libc to support debugmozjs on windows.
-
crowbot
Status submitted successfully.
-
BitBot
[GitHub] (servo/servo) [issue] asajeffrey opened #23733: Support serializable tasks in script? -
git.io/fjipH
-
Manishearth
ajeffrey: i considered doig this, it's a lot of work to get correctly
-
Manishearth
serializing tasks is not the problem, serializing DOM objects is
-
Manishearth
i think the right solution is to have a registry of Any objects in a hashmap somewhere (address-keyed because why not)
-
Manishearth
and the ability to create a ScriptPinger<T> that internally contains a ScriptThreadSender, but can only send messages of type T (cast to ScriptThreadMsg::Custom(Box<T as Any>)
-
Manishearth
and when you receive it it does all the downcasting
-
Manishearth
and creates a task
-
Manishearth
the hashmap registry thing also contains task sources and cancellers
-
BitBot
[GitHub] (servo/servo) [PR] bors-servo merged #23732 into master: Sync WPT with upstream (09-07-2019) -
git.io/fjiNE
-
ajeffrey
Manishearth: yeah, something like that, plus some checks that you're back at the originating process, in the same way as Trusted checks you're back at the originating thread.
-
ajeffrey
quite a bit of hoop-jumping to avoid a context switch, probably not worth doing right away.
-
Manishearth
yeah
-
Manishearth
ajeffrey: well.
-
Manishearth
ajeffrey: no need for those checks, this is literally in the script thread
-
Manishearth
like, only script can receive these
-
Manishearth
yes
-
Manishearth
i sketched a rough design and then decided that i didn't want to open that can of yak shaves
-
Manishearth
i can write out the design if you want
-
ajeffrey
Manishearth: there's more than one content process though, and addresses aren't unique across processes.
-
Manishearth
ajeffrey: i don't see why that's a problem
-
Manishearth
you're handing out IPC senders to the content process itself
-
Manishearth
not some new kind of sender
-
Manishearth
(is that safe?)
-
Manishearth
ajeffrey: also yeah i def want oneshot tasks in the api
-
ajeffrey
Manishearth: ah, that would work, if the IPC sender is bundled with a payload that is guaranteed to be run by that script thread.
-
Manishearth
it was part of my Plan
-
Manishearth
ajeffrey: yep.
-
Manishearth
well, more like this
-
BitBot
[GitHub] (servo/blog.servo.org) [PR] ferjm requested #180 merge into gh-pages: Media stack Mid-Year review -
git.io/fjihD
-
Manishearth
fn create_task_callback<T>(FnOnce(T), TaskSource) -> ScriptPinger<T>
-
Manishearth
ScriptPinger<T> has a function send(T)
-
Manishearth
ScriptPinger<T> is {IpcSender<ScriptThreadMsg>, id: usize}, and send(T) does self.sender.send(ScripTTHreadMsg::Custom(Box::new(T) as Box<Any>))
-
Manishearth
does my terrible pseudocode make sense?
-
Manishearth
ajeffrey: where's to_untyped?
-
ajeffrey
-
ajeffrey
turns out rigid transforms don't have it though :(
-
Manishearth
ajeffrey: i'm not on typedtransform
-
Manishearth
yep
-
Manishearth
and i can't add it without also adding one to TypedRotation
-
Manishearth
it's ugly
-
ajeffrey
Manishearth: oh, and TypedTranslation only has one type argument, not two?
-
ajeffrey
euclid treats spaces that only disagree in their origin as being the same.
-
ajeffrey
*TypedVector
-
Manishearth
ajeffrey: yep
-
ajeffrey
Manishearth: sigh
-
Manishearth
i think typed units are good provided there are easy ways to cast
-
ajeffrey
so euclid's types won't catch errors like originOffset.
-
Manishearth
originOffset is a full transform
-
Manishearth
i feel like a .cast_src() and .cast_dst() and then .cast() would make this easy to work with
-
ajeffrey
Manishearth: yes, you need some way to switch off the type system when needed.
-
Manishearth
typed units are good, but really there's no way to do it perfectly (Vectors are a great example of this) since there will *always* be a confusion between "transformation in a space" and "transformation between spaces"
-
Manishearth
and often they're interchangeable
-
Manishearth
furthermore the order flips when you're talking about transformations as origins (as in, position, orientation pairs)
-
Manishearth
this stuff plagued the webxr spec
-
Manishearth
and led to frequent confusions, till i pointed it out
-
Manishearth
in physics we use covariance and contravariance to talk about this, but that's only in tensor math
-
Manishearth
> furthermore the order flips when you're talking about transformations as origins
-
Manishearth
i.e. you have two ways of talking about a transform
-
Manishearth
"the transformation that you apply to coordinates in base space to get coordinates in viewer space"
-
Manishearth
and
-
ajeffrey
Manishearth: yeah, I can imagine the cries of anguish if we start putting too much algebra in the euclid types.
-
Manishearth
"the transformation you apply to the *coordinate grid* of base space to get the *coordinate grid* of viewer sace"
-
Manishearth
these are inverses
-
Manishearth
the problem is that both use the from/to language
-
Manishearth
so it's confusing
-
Manishearth
basis-change transformations (i.e. things which transform coordinate grids) are covariant
-
Manishearth
er
-
Manishearth
sorry, the opposte
-
ajeffrey
Manishearth: somewhat off-topic, but have you read
bentnib.org/conservation-laws.html ?
-
Manishearth
things which transform coordinates are covariant, whereas things which transform coordinate spaces are contravariant
-
ajeffrey
it's what happens if you really push on putting algebra into the types for linear algebra.
-
Manishearth
ajeffrey: i've seen it, because i had the same rough idea once :)
-
Manishearth
noether's theorem is a mathematical result so at some point i realized you could apply it to programming
-
ajeffrey
Manishearth: :)
-
Manishearth
didn't know enough about type theory to actually *do* that, but i did google it and find the paper
-
ajeffrey
Manishearth: we could implement the cast on rigid transforms by pulling them apart then putting them back together again,
-
ajeffrey
and hoping that the compiler is smart enough to realize it's just an identity function.
-
Manishearth
yep
-
Manishearth
rotations don't have cast either iirc
-
Manishearth
nope
-
ajeffrey
Manishearth: yes, we'd need to do something like Rotation::new(rot.i, rot.j, rot.k, rot.r) sigh.
-
Manishearth
yep
-
ajeffrey
Manishearth: for the mocking api... would you rather have something that looks like rust-webvr/mock or like
github.com/immersive-web/webxr-test-api ?
-
Manishearth
ajeffrey: rust-webvr/mock is webxr-test-api
-
Manishearth
i wrote both
-
Manishearth
yeah, just copy over rust-webvr/mock
-
Manishearth
ajeffrey: we already have the DOM apis for mocking
-
ajeffrey
Manishearth: ok
-
Manishearth
i'll note down my planned design for the ipc thingy
-
jdm
-
jdm
-
Manishearth
jdm: a+ commit names
-
SimonSapin
standups: read through the code and docs in the skribo repository, rebased and merged open PRs
-
crowbot
Status submitted successfully.
-
Manishearth
hmmm, looks like the script event loop doesn't listen to IPC?
-
Manishearth
ajeffrey: ^ looks like the script thread currently doesn't have any way to receive messages over IPC without a context switch
-
Manishearth
it uses a router for constellation
-
jdm
yeah, we can't select over ipc and non-ipc without a router
-
Manishearth
in that case idk how much this matters
-
Manishearth
we can still reduce the number of channels in the ipc router though
-
ajeffrey
jdm: oooh, debugmozjs on windows
-
ajeffrey
Manishearth: yes, select is only on intra-process channels, not IPC so the only way to listen to multiple channels some of which are IPC is to use ROUTER.
-
ajeffrey
Sigh.
-
Manishearth
is it still worth investigating if we have to router anyway?
-
ajeffrey
not atm at least,
-
Manishearth
cool
-
ajeffrey
I think it would take a pretty radical overhaul of how servo does IPC.
-
Manishearth
okay
-
ajeffrey
Trying to make servo use less threads is a bit of a losing battle.
-
ajeffrey
Oh well, at least we're not spawning one thread per mouse event any more.
-
Manishearth
lol
-
jdm
-
BitBot
[GitHub] (servo/blog.servo.org) [PR] ferjm merged #180 into gh-pages: Media stack Mid-Year review -
git.io/fjihD
-
BitBot
[GitHub] (servo/webrender) [PR] bors-servo merged #3695 into master: Sync changes from mozilla-central -
git.io/fj6Pn
-
BitBot
[GitHub] (servo/mozjs) [PR] jdm requested #190 merge into master: Support debugmozjs on Windows. -
git.io/fjPfm
-
Manishearth
ajeffrey: there?
-
Manishearth
gonna grab lunch soon and also set up a dentist appointment, but how would you think an events api would look?
-
Manishearth
to do input *properly*, we need to listen for input devices being connected
-
ajeffrey
Manishearth: should input devices be independent of displays?
-
ajeffrey
or are they tightly coupled?
-
ajeffrey
it's probably easier if they're independent, that way we can just have the registry handle them.
-
Manishearth
ajeffrey: in webxr? coupled
-
Manishearth
in webvr? independent
-
Manishearth
er
-
Manishearth
so XRInputSources are coupled
-
Manishearth
they contain gamepads, which can exist without a session
-
Manishearth
for now i was going to make this only handle input devices connected to the session
-
ajeffrey
Manishearth: can we assume each input device knows which output device it
-
ajeffrey
's associated with?
-
Manishearth
as in?
-
ajeffrey
If you connect an oculus gamepad, it knows to register itself with the oculus device.
-
Manishearth
backend's responsibility imo
-
ajeffrey
hmm, so when a gamepad is connected, we iterate through all the Discovery objects finding one that knows how to handle it?
-
Manishearth
no, i mean that the device backend knows how to detect a gamepad is connected
-
Manishearth
there's no generic "a gamepad was connected" api the system gives us
-
ajeffrey
what if two back ends recognize the device?
-
Manishearth
"oops"
-
ajeffrey
:)
-
Manishearth
we need a good solution for this eventually, i don't think we should now though
-
Manishearth
you only have one sessio nat a time though
-
Manishearth
so that session is the one that detects devices
-
Manishearth
inline is complicated
-
Manishearth
inline shouldn't have input sources aside from screenspace input i guess
-
Manishearth
wait no it can
-
ajeffrey
Manishearth: yes, every time I see that I think "that's something that's going to change"
-
ajeffrey
e.g. two-player games with two HMDs attached to the same host.
-
Manishearth
ajeffrey: alternatively for now i can build it on the assumption that input sources are set on creation
-
Manishearth
which is what rust-webvr did
-
Manishearth
and we can transition this in a followup
-
Manishearth
(all our backends do this anyway)
-
Manishearth
wait we need to listen for events anyway though
-
Manishearth
hm
-
Manishearth
ajeffrey: i'll just make it an event
-
Manishearth
actually no
-
Manishearth
i also need to set inputs on creation anyway
-
Manishearth
uh, i'll do the event thing later
-
ajeffrey
this shouldn't be so bad, since we're running an rAF loop anyway, we don't have to worry about a waker API, polling is fine.
-
Manishearth
yeah so the actual input state gets sent in the raf loop
-
ajeffrey
Manishearth: dumb naming question... Mock* vs Fake*
-
ajeffrey
opinions about which naming scheme webxr should use?
-
lqd
Fock
-
ajeffrey
Feck
-
ajeffrey
(for all you Father Ted fans out there)
-
lqd
Peck, for the Willow fans out there
-
Manishearth
ajeffrey: Mock
-
Manishearth
no strong opinion
-
Manishearth
the api doesn't mirror the test api, it provides the underlying things necessary to do so
-
ajeffrey
Manishearth: neither have I, hence the question :)
-
georgeroman
-
crowbot
Status submitted successfully.
-
jdm
georgeroman++
-
jdm
-
georgeroman
jdm: That's really cool, thanks!
-
Manishearth
ajeffrey: so what i think ill do is for now on initialization give information on what input sources exist and let the session request input info on each frame
-
Manishearth
or, eh, i can just send it unconditionally for now
-
ajeffrey
Manishearth: so the SessionThread will poll the Device?
-
omar
I just wanna thank everyone for naming threads in Servo. It's super useful!
-
omar
> 0:02.73 pid:22786 thread_id not initialized (thread WRRenderBackend#0, at src/libcore/option.rs:1034)
-
omar
<3
-
ajeffrey
Manishearth: current state of the mock API...
asajeffrey/webxr 06ee9b0
-
jdm
omar: :D
-
ajeffrey
standups: Working on a mock API for webxr testing.
-
crowbot
Status submitted successfully.
-
jdm
standups: removing non-UWP-safe gstreamer plugins from UWP app.
-
crowbot
Status submitted successfully.
-
BitBot
[GitHub] (servo/servo) [issue] jdm opened #23734: No stdout/stderr in UWP app -
git.io/fjPUf
-
BitBot
[GitHub] (servo/mozjs) [PR] bors-servo merged #190 into master: Support debugmozjs on Windows. -
git.io/fjPfm
-
georgeroman
standups: work on GetElementProperty wd command
-
crowbot
Status submitted successfully.