Skip to content

dominik/crash 0109 bg num running compile tasks - #143

Merged
Domiii merged 1 commit into
dominik/crash-0109-compile-disallowsfrom
dominik/crash-0109-bg-num-running-compile-tasks
Sep 22, 2026
Merged

Domiii merged 1 commit into
dominik/crash-0109-compile-disallowsfrom
dominik/crash-0109-bg-num-running-compile-tasks

Conversation

@Domiii

@Domiii Domiii commented Sep 22, 2026 •

Copy link
Copy Markdown

Summary

  • Track NumRunningBackgroundCompileTasks across BackgroundCompileTask::Run.

Why

  • Chromium RR opcode-emit checks need the counter.
  • Node lacked it.

Change

  • compiler.cc.

@Domiii
Domiii added this pull request to stack #140 September 22, 2026 12:12
@Domiii Domiii self-assigned this Sep 22, 2026
@Domiii
Domiii force-pushed the dominik/crash-0109-bg-num-running-compile-tasks branch from 4f6a6bc to 480c026 Compare September 22, 2026 16:15
@Domiii
Domiii merged commit 7778d5a into master Sep 22, 2026
2 of 3 checks passed
bhackett1024 pushed a commit that referenced this pull request Nov 5, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist added a commit that referenced this pull request Nov 6, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist added a commit that referenced this pull request Nov 6, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist added a commit that referenced this pull request Nov 6, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 6, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 6, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 6, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist added a commit that referenced this pull request Nov 6, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 10, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist pushed a commit that referenced this pull request Nov 11, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist added a commit that referenced this pull request Nov 11, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist added a commit that referenced this pull request Nov 11, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Andarist added a commit that referenced this pull request Nov 12, 2026
Decide once per script whether its bytecode carries record/replay
instrumentation, so recompiles caused by bytecode flushing or cache
ageing get the same instrumentation as the first compile. The decision
is stored on the Script itself (a new record_replay_instrumented flag,
set in ParseInfo::CreateScript from the compile that creates the script)
and every later compile of that script inherits it through
RecordReplayInheritCompileFlags. The FinalizeBytecode CHECK that the
ignore flag matched the script is dropped, as it no longer holds.

Register a script as a Replay source as soon as its main-thread
compile finishes: ScriptCompiler::CompileUnboundInternal and the
streamed-source compile call RecordReplayRegisterCompiledScript,
instead of waiting for the script's function to be instantiated, which
never happens for an ES module whose import graph failed to load, so
the recording had no source for it. At the first checkpoint, the
progress counter is reset (with a ProgressBeforeFirstCheckpoint
warning if anything advanced it) and the sources registered until then
are announced, since the recorder only takes sources from the first
checkpoint on.

Invalidate the recording when --lazy-compile-dispatcher or
--parallel-compile-tasks is on: the dispatcher compiles functions on
worker threads whose timing decides when the main thread installs a
function's bytecode, or whether it waits for a worker, so such a
recording doesn't replay reliably. The flags are left as requested.

Also count the background compile tasks currently running, for
checking that record/replay opcodes are only emitted on the main
thread. Nothing reads the counter yet.

Rebase note: the invariant is that one script's bytecode is either
always instrumented or never, and that only main-thread compiles
instrument, so the decision belongs to ParseInfo::CreateScript and
every other path that builds UnoptimizedCompileFlags for an existing
script must take the flags from that script. A new Script flag bit
also needs its Torque bitfield (script.tq) kept in sync.

From #128, #132, #143 and #217.

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants