Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSPI Fuzzing: Interleave executions #7226

Merged
merged 55 commits into from
Jan 24, 2025
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
93c4196
star
kripken Jan 10, 2025
e220432
work
kripken Jan 10, 2025
211d585
chak
kripken Jan 10, 2025
9610d85
fixes
kripken Jan 10, 2025
ade1ebe
fixes
kripken Jan 10, 2025
bf5d537
fix
kripken Jan 10, 2025
8b25475
temp
kripken Jan 10, 2025
5514a2c
fix
kripken Jan 10, 2025
96df913
sad
kripken Jan 10, 2025
02b6bfd
fix
kripken Jan 10, 2025
824908c
work
kripken Jan 10, 2025
ef26967
work
kripken Jan 10, 2025
1ef833a
test
kripken Jan 10, 2025
70046a7
work
kripken Jan 10, 2025
ba381d4
test
kripken Jan 11, 2025
adc74f2
moof
kripken Jan 11, 2025
5fbb4d5
todo
kripken Jan 11, 2025
5af6120
start
kripken Jan 11, 2025
9e68a3b
test
kripken Jan 11, 2025
ed01751
test
kripken Jan 11, 2025
d01a605
fix?
kripken Jan 16, 2025
0f3b1dd
Merge remote-tracking branch 'origin/main' into d8.test
kripken Jan 16, 2025
bfb4d38
coverage run too
kripken Jan 16, 2025
c053377
Merge remote-tracking branch 'origin/main' into d8.test
kripken Jan 16, 2025
8d1a559
no errors on invalid yml, very sad
kripken Jan 16, 2025
94d9d01
Merge branch 'd8.test' into fuzz.interleave.jspi
kripken Jan 16, 2025
d806a95
jsvu needs bash
kripken Jan 17, 2025
6931fd5
Merge remote-tracking branch 'myself/d8.test' into fuzz.interleave.jspi
kripken Jan 17, 2025
7b00d01
DEBUG-REVERTME
kripken Jan 17, 2025
5bf3756
work around alpine testing REVERTME
kripken Jan 17, 2025
0d7668a
Revert "work around alpine testing REVERTME"
kripken Jan 17, 2025
e7c55e3
Revert "DEBUG-REVERTME"
kripken Jan 17, 2025
b793595
try to delete rather than skip
kripken Jan 17, 2025
a44418f
undo.moar
kripken Jan 17, 2025
d479e99
try
kripken Jan 17, 2025
14816ee
finish
kripken Jan 17, 2025
48e9392
apply to release too
kripken Jan 17, 2025
686d39b
Merge branch 'd8.test' into fuzz.interleave.jspi
kripken Jan 17, 2025
ea31e3c
Merge remote-tracking branch 'myself/fuzz.interleave.jspi' into fuzz.…
kripken Jan 17, 2025
09badf2
undo
kripken Jan 17, 2025
686403f
Merge remote-tracking branch 'origin/main' into fuzz.interleave.jspi
kripken Jan 17, 2025
b7abf06
Merge remote-tracking branch 'origin/main' into fuzz.interleave.jspi
kripken Jan 17, 2025
13a4a4d
fix test
kripken Jan 18, 2025
3c246b9
try to fix windows
kripken Jan 18, 2025
663a667
DEBUG.WINDOWS.1
kripken Jan 21, 2025
110069b
DEBUG.WINDOWS.2
kripken Jan 21, 2025
3a57dad
DEBUG.WINDOWS.3
kripken Jan 21, 2025
d570dcc
DEBUG.WINDOWS.4
kripken Jan 21, 2025
639c964
UNDO
kripken Jan 21, 2025
f4d4311
clean
kripken Jan 21, 2025
9cca44c
split
kripken Jan 22, 2025
3bfdbe5
split
kripken Jan 22, 2025
15fa8fe
simpl
kripken Jan 22, 2025
2daccd2
add chaining todo
kripken Jan 23, 2025
1dd5feb
add chaining todo
kripken Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixes
kripken committed Jan 10, 2025

Verified

This commit was signed with the committer’s verified signature.
knelli2 Kyle Nelli
commit ade1ebea186a4e0e4c699d16ff949259bccffe58
12 changes: 7 additions & 5 deletions scripts/fuzz_shell.js
Original file line number Diff line number Diff line change
@@ -441,8 +441,9 @@ function hashCombine(seed, value) {
}

// When we are changing up the order, in JSPI we can also leave some
// Promises unresolved until later, which lets us interleave them.
if (JSPI && ordering !== undefined) {
// Promises unresolved until later, which lets us interleave them. Note we
// never defer a task more than once (which would be pointless).
if (JSPI && ordering !== undefined && !task.deferred) {
if (result && typeof result == 'object' &&
typeof result.then === 'function') {
// Hash with -1 here, just to get something different than the hashing a
@@ -453,11 +454,12 @@ function hashCombine(seed, value) {
result = /* await */ result;
} else {
// Defer it for later. Reuse the existing task for simplicity.
console.log(`(defer ${task.name})`);
console.log(`(jspi: defer ${task.name})`);
task.func = /* async */ () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is all in if (JSPI), do the async and await need to be comments?

Copy link
Member Author

@kripken kripken Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My (perhaps overly paranoid) approach was that when JSPI is off, we don't want the JS VM to see any async stuff, which could affect codegen. Like maybe they lay out the stack or basic blocks differently in async functions?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would hope these isolated awaits/asyncs would not affect other code. Anway, I'm fine with leaving them since it's consistent with all the other uses.

console.log(`(finish ${task.name})`);
return /* await */ result
console.log(`(jspi: finish ${task.name})`);
return /* await */ result;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this await be in a try/catch as well? If the suspended Wasm ends up throwing an error, that error would propagate out here IIUC.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the try-catch on 468 is enough? This code ends up run in that try-catch, so yes, an exception would propagate, but just to that try-catch, where it is caught and handled. (Note that we can't really add any handling for it here - all we could do is log and rethrow?)

};
task.deferred = true;
tasks.push(task);
continue;
}