Skip to content

fix(common): include offending index in HybridIndexVec panic message#9296

Merged
IWANABETHATGUY merged 4 commits into
rolldown:mainfrom
SAY-5:fix/hybrid-index-vec-9293
May 9, 2026
Merged

fix(common): include offending index in HybridIndexVec panic message#9296
IWANABETHATGUY merged 4 commits into
rolldown:mainfrom
SAY-5:fix/hybrid-index-vec-9293

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 5, 2026

Copy link
Copy Markdown
Contributor

The bare expect("should have idx") at crates/rolldown_common/src/types/hybrid_index_vec.rs:69 (and the get_mut sibling on line 60) gives zero diagnostic context. When users hit this panic — e.g. the intermittent Vite bundledDev branch-switch crash in #9293 — the report carries only "should have idx" and a stripped napi backtrace, so triage cannot proceed without local repro.

This patch includes the missing Idx (via the trait's existing Debug bound) and the current map length in both panic messages, so future bug reports include idx N (len=M) directly.

No behavior change on the success path; panic-only diagnostic improvement.

Refs #9293

@codspeed-hq

codspeed-hq Bot commented May 5, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing SAY-5:fix/hybrid-index-vec-9293 (d0eeca8) with main (d69e071)2

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (d3ae8ba) during the generation of this report, so d69e071 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Comment thread crates/rolldown_common/src/types/hybrid_index_vec.rs
@netlify

netlify Bot commented May 9, 2026

Copy link
Copy Markdown

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit d0eeca8
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69ff0c332d95d20008a481fb

SAY-5 and others added 2 commits May 9, 2026 15:58
The bare expect("should have idx") at hybrid_index_vec.rs:69 (and the
get_mut sibling) gives no diagnostic information, making panics like
the one in rolldown#9293 (intermittent during Vite bundledDev branch-switch)
impossible to triage from a user report. Include the missing index
and current map length in the panic message so reproducers carry
actionable context.

Signed-off-by: SAY-5 <say.apm35@gmail.com>
  panic path in HybridIndexVec::get_mut
@IWANABETHATGUY IWANABETHATGUY force-pushed the fix/hybrid-index-vec-9293 branch from 9b86517 to f99df5f Compare May 9, 2026 07:58
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@IWANABETHATGUY IWANABETHATGUY enabled auto-merge (squash) May 9, 2026 10:07
…onsistency with get

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@IWANABETHATGUY IWANABETHATGUY merged commit 9c3c339 into rolldown:main May 9, 2026
33 checks passed
@rolldown-guard rolldown-guard Bot mentioned this pull request May 13, 2026
shulaoda added a commit that referenced this pull request May 13, 2026
## [1.0.1] - 2026-05-13

### 🚀 Features

- experimental/lazy-barrel: advice on oversized barrel modules (#9236) by @shulaoda
- rolldown: inline optional-chain enum access (#9379) by @Dunqing
- chunk-optimization: dedupe already-loaded dynamic deps (#9305) by @IWANABETHATGUY
- binding: call moduleParsed hook in ParallelJsPlugin (#9318) by @jaehafe

### 🐛 Bug Fixes

- transform: enable `enum_eval` for `transformSync` and vite TS transform (#9325) by @Dunqing
- error: remove severity prefix from diagnostic messages (#9262) by @Kyujenius
- deps: pin pnpm to 10.23.0 to work around catalog mismatch on Netlify (#9364) by @shulaoda
- ci: pin mimalloc-safe to 0.1.58 (#9361) by @shulaoda
- dev/lazy: fix exports of lazy requests in lazy chunks (#9249) by @h-a-n-a
- rolldown_plugin_vite_resolve: handle errors in `resolveSubpathImports` callback (#9355) by @sapphi-red
- rolldown_plugin_lazy_compilation: use loadExports for fetched proxy to preserve original export names (#9132) by @h-a-n-a
- common: include offending index in HybridIndexVec panic message (#9296) by @SAY-5

### 🚜 Refactor

- ecmascript: extract semantic_builder_for_transform helper (#9326) by @Dunqing
- test: extract reusable static-import-cycle helper (#9332) by @IWANABETHATGUY

### 📚 Documentation

- clarify scope of `topLevelVar` (#9380) by @IWANABETHATGUY
- meta/design: add ast-mutation design doc (#9338) by @hyf0
- feat: add ai policy in contribution guide (#9315) by @mdong1909

### ⚡ Performance

- binding: enable mimalloc v3 to reduce idle memory (#9349) by @shulaoda

### 🧪 Testing

- mcs: cover require() in `$initial` group (#9376) by @hyf0
- add regression for CJS facade chunk merge into entry (#9351) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- switch prepare-release to manual dispatch with version input (#9383) by @shulaoda
- migrate `@rolldown/pluginutils` to `rolldown/plugins` (#9317) by @shulaoda
- deps: pin libmimalloc-sys2 to 0.1.54 (#9372) by @shulaoda
- replace `igorskyflyer/action-readfile` with `cat` (#9369) by @sapphi-red
- deps: update test262 submodule for tests (#9371) by @rolldown-guard[bot]
- use app token for test dep update PRs (#9368) by @sapphi-red
- replace some actions with gh commands (#9367) by @sapphi-red
- replace action-semantic-pull-request with inline regex (#9366) by @sapphi-red
- remove pull_request_target workflows (#9188) by @Boshen
- deps: upgrade oxc to 0.130.0 (#9360) by @shulaoda
- deps: update github actions (major) (#9348) by @renovate[bot]
- deps: update github actions (#9341) by @renovate[bot]
- deps: update rust crates (#9344) by @renovate[bot]
- deps: update crate-ci/typos action to v1.46.1 (#9357) by @renovate[bot]
- deps: update npm packages (#9343) by @renovate[bot]
- deps: update pnpm to v10.33.4 (#9347) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to ^0.25.0 (#9346) by @renovate[bot]
- .claude: add rolldown-repl encoder, rename decode skill (#9352) by @IWANABETHATGUY
- deps: update crate-ci/typos action to v1.46.0 (#9345) by @renovate[bot]
- deps: update napi to v3.8.6 (#9342) by @renovate[bot]
- deps: update dependency vite-plus to v0.1.20 (#9340) by @renovate[bot]
- enable rollup chunking-form test (#9335) by @IWANABETHATGUY
- typo: fix typo in watcher options comment (#9324) by @thescripted

### ❤️ New Contributors

* @Kyujenius made their first contribution in [#9262](#9262)
* @SAY-5 made their first contribution in [#9296](#9296)
* @thescripted made their first contribution in [#9324](#9324)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
@apollonorth

Copy link
Copy Markdown

@IWANABETHATGUY @SAY-5 I was unable to create a repo for reproduction of my initial panics. However, switching to Vite 8.0.13, which uses Rolldown 1.0.1, I am still experiencing the same panics in my company's repo. It occurs when switching branches with lots of changes between the branches, and seems more likely to occur the longer the dev server has been running.

Here is the new error message with the missing idx:

Rolldown panicked. This is a bug in Rolldown, not your code.

thread 'rolldown-worker' (27033106) panicked at crates/rolldown_common/src/types/hybrid_index_vec.rs:76:28:
HybridIndexVec::Map missing idx 12544 (len=6)
stack backtrace:
   0:        0x11c62f574 - _napi_register_module_v1
   1:        0x11c643c88 - _napi_register_module_v1
   2:        0x11c633ccc - _napi_register_module_v1
   3:        0x11c619138 - _napi_register_module_v1
   4:        0x11c6283a8 - _napi_register_module_v1
   5:        0x11baf8fe4 - <unknown>
   6:        0x11c62870c - _napi_register_module_v1
   7:        0x11c6191e4 - _napi_register_module_v1
   8:        0x11c61072c - _napi_register_module_v1
   9:        0x11c619898 - _napi_register_module_v1
  10:        0x11c6f2df4 - _napi_register_module_v1
  11:        0x11bcd394c - <unknown>
  12:        0x11bcd080c - <unknown>
  13:        0x11bce9404 - <unknown>
  14:        0x11bd0ef5c - <unknown>
  15:        0x11ba87510 - <unknown>
  16:        0x11ba88974 - <unknown>
  17:        0x11ba2b8c0 - <unknown>
  18:        0x11bc6e0e4 - <unknown>
  19:        0x11c4c1b74 - _napi_register_module_v1
  20:        0x11c4bff14 - _napi_register_module_v1
  21:        0x11c4b81f4 - _napi_register_module_v1
  22:        0x11c4af80c - _napi_register_module_v1
  23:        0x11c4b0508 - _napi_register_module_v1
  24:        0x11c62e834 - _napi_register_module_v1
  25:        0x187363bc8 - __pthread_cond_wait

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

@IWANABETHATGUY

Copy link
Copy Markdown
Member

@IWANABETHATGUY @SAY-5 I was unable to create a repo for reproduction of my initial panics. However, switching to Vite 8.0.13, which uses Rolldown 1.0.1, I am still experiencing the same panics in my company's repo. It occurs when switching branches with lots of changes between the branches, and seems more likely to occur the longer the dev server has been running.

Here is the new error message with the missing idx:

Rolldown panicked. This is a bug in Rolldown, not your code.

thread 'rolldown-worker' (27033106) panicked at crates/rolldown_common/src/types/hybrid_index_vec.rs:76:28:
HybridIndexVec::Map missing idx 12544 (len=6)
stack backtrace:
   0:        0x11c62f574 - _napi_register_module_v1
   1:        0x11c643c88 - _napi_register_module_v1
   2:        0x11c633ccc - _napi_register_module_v1
   3:        0x11c619138 - _napi_register_module_v1
   4:        0x11c6283a8 - _napi_register_module_v1
   5:        0x11baf8fe4 - <unknown>
   6:        0x11c62870c - _napi_register_module_v1
   7:        0x11c6191e4 - _napi_register_module_v1
   8:        0x11c61072c - _napi_register_module_v1
   9:        0x11c619898 - _napi_register_module_v1
  10:        0x11c6f2df4 - _napi_register_module_v1
  11:        0x11bcd394c - <unknown>
  12:        0x11bcd080c - <unknown>
  13:        0x11bce9404 - <unknown>
  14:        0x11bd0ef5c - <unknown>
  15:        0x11ba87510 - <unknown>
  16:        0x11ba88974 - <unknown>
  17:        0x11ba2b8c0 - <unknown>
  18:        0x11bc6e0e4 - <unknown>
  19:        0x11c4c1b74 - _napi_register_module_v1
  20:        0x11c4bff14 - _napi_register_module_v1
  21:        0x11c4b81f4 - _napi_register_module_v1
  22:        0x11c4af80c - _napi_register_module_v1
  23:        0x11c4b0508 - _napi_register_module_v1
  24:        0x11c62e834 - _napi_register_module_v1
  25:        0x187363bc8 - __pthread_cond_wait

Please report this issue at: https://github.com/rolldown/rolldown/issues/new?template=panic_report.yml

This issue only aims to improve the quality of the error message, not a fix of #9293

IWANABETHATGUY pushed a commit that referenced this pull request May 18, 2026
## [1.0.1] - 2026-05-13

### 🚀 Features

- experimental/lazy-barrel: advice on oversized barrel modules (#9236) by @shulaoda
- rolldown: inline optional-chain enum access (#9379) by @Dunqing
- chunk-optimization: dedupe already-loaded dynamic deps (#9305) by @IWANABETHATGUY
- binding: call moduleParsed hook in ParallelJsPlugin (#9318) by @jaehafe

### 🐛 Bug Fixes

- transform: enable `enum_eval` for `transformSync` and vite TS transform (#9325) by @Dunqing
- error: remove severity prefix from diagnostic messages (#9262) by @Kyujenius
- deps: pin pnpm to 10.23.0 to work around catalog mismatch on Netlify (#9364) by @shulaoda
- ci: pin mimalloc-safe to 0.1.58 (#9361) by @shulaoda
- dev/lazy: fix exports of lazy requests in lazy chunks (#9249) by @h-a-n-a
- rolldown_plugin_vite_resolve: handle errors in `resolveSubpathImports` callback (#9355) by @sapphi-red
- rolldown_plugin_lazy_compilation: use loadExports for fetched proxy to preserve original export names (#9132) by @h-a-n-a
- common: include offending index in HybridIndexVec panic message (#9296) by @SAY-5

### 🚜 Refactor

- ecmascript: extract semantic_builder_for_transform helper (#9326) by @Dunqing
- test: extract reusable static-import-cycle helper (#9332) by @IWANABETHATGUY

### 📚 Documentation

- clarify scope of `topLevelVar` (#9380) by @IWANABETHATGUY
- meta/design: add ast-mutation design doc (#9338) by @hyf0
- feat: add ai policy in contribution guide (#9315) by @mdong1909

### ⚡ Performance

- binding: enable mimalloc v3 to reduce idle memory (#9349) by @shulaoda

### 🧪 Testing

- mcs: cover require() in `$initial` group (#9376) by @hyf0
- add regression for CJS facade chunk merge into entry (#9351) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- switch prepare-release to manual dispatch with version input (#9383) by @shulaoda
- migrate `@rolldown/pluginutils` to `rolldown/plugins` (#9317) by @shulaoda
- deps: pin libmimalloc-sys2 to 0.1.54 (#9372) by @shulaoda
- replace `igorskyflyer/action-readfile` with `cat` (#9369) by @sapphi-red
- deps: update test262 submodule for tests (#9371) by @rolldown-guard[bot]
- use app token for test dep update PRs (#9368) by @sapphi-red
- replace some actions with gh commands (#9367) by @sapphi-red
- replace action-semantic-pull-request with inline regex (#9366) by @sapphi-red
- remove pull_request_target workflows (#9188) by @Boshen
- deps: upgrade oxc to 0.130.0 (#9360) by @shulaoda
- deps: update github actions (major) (#9348) by @renovate[bot]
- deps: update github actions (#9341) by @renovate[bot]
- deps: update rust crates (#9344) by @renovate[bot]
- deps: update crate-ci/typos action to v1.46.1 (#9357) by @renovate[bot]
- deps: update npm packages (#9343) by @renovate[bot]
- deps: update pnpm to v10.33.4 (#9347) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to ^0.25.0 (#9346) by @renovate[bot]
- .claude: add rolldown-repl encoder, rename decode skill (#9352) by @IWANABETHATGUY
- deps: update crate-ci/typos action to v1.46.0 (#9345) by @renovate[bot]
- deps: update napi to v3.8.6 (#9342) by @renovate[bot]
- deps: update dependency vite-plus to v0.1.20 (#9340) by @renovate[bot]
- enable rollup chunking-form test (#9335) by @IWANABETHATGUY
- typo: fix typo in watcher options comment (#9324) by @thescripted

### ❤️ New Contributors

* @Kyujenius made their first contribution in [#9262](#9262)
* @SAY-5 made their first contribution in [#9296](#9296)
* @thescripted made their first contribution in [#9324](#9324)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.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.

3 participants