dotnet / dotnet/runtime

Remove File Level Padding Requirement in Webcil

Open
#133,139 9 comments 0 reactions 0 assignees View on GitHub
arch-wasm area-ReadyToRun needs-area-label
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

WebCIL requires the data segment containing the Webcil payload to be aligned to 4 bytes at the **file** level. To accomplish this, trailing padding should be added to the prior segment which contains the payload size. The rationale is given in the spec as:

> (Rationale: The alignment requirement is due to ECMA-335 metadata requiring certain portions of the physical layout to be 4-byte aligned, for
> example ECMA-335 Section II.25.4 and II.25.4.5. Aligning the Webcil content within the wasm module allows tools that directly examine the wasm
> module without instantiating it to properly parse the ECMA-335 metadata in the Webcil payload.)

This requirement is a little unnatural given that Wasm itself doesn't tend to have these sorts of file-level alignment constraints. We should audit whether any tools do rely on this feature and consider removing the requirement from the Webcil spec to simplify things.

Contributor guide

Open the contributing guide

Research direction

Start by reading the Webcil specification's file-level alignment requirement and auditing the tools that directly inspect WebAssembly modules or Webcil payloads. Determine whether any tool relies on the alignment, then document the compatibility findings and whether the specification can remove the requirement.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, wasm
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.