Fix WASM cfg proxy: remove test arm from wasm32 guards#116
Conversation
|
@cscheid I'm gonna want something like wasm-qmd-parser again in the future for the Quarto extension, but putting that off for now. |
|
Let's leave it then - I was just trying to cleanup while understanding things around and fixing the problem I found. |
|
Done — I've kept the crate skeleton (Cargo.toml, src/, tests/, licenses) and cleaned up the stale parts (old CI configs, C shim superseded by Edit: I’ll probably split work on this. No need to cleanup if you plan to rework on it. But this is definitely stale. |
The cfg pattern #[cfg(any(target_arch = "wasm32", test))] forced native tests through the WASM-restricted Lua stdlib (no io/os, synthetic modules only). This caused 8 Windows test failures because the restricted stdlib doesn't work without a real wasm32 target. Change to #[cfg(target_arch = "wasm32")] so native tests use Lua::new() with the full C stdlib on all platforms. WASM-specific code paths will be tested by dedicated WASM smoke tests on the real wasm32 target in CI.
The test_dofile_script_dir_stack test validates WASM-specific dofile behavior (script directory tracking via the VFS dofile override). The native C dofile does not track the script directory stack, so this test only passes on wasm32. Mark it ignored on native targets. See #112 for the behavioral difference discussion.
- Add .claude/rules/wasm.md: prevent cfg test proxy regression - Update xtask.md: wasm-pack → wasm-bindgen-cli, add version pinning - Update testing.md: native tests use Lua::new(), remove stale cfg proxy docs - Rewrite dev-docs/wasm.md: replace stale wasm-qmd-parser content with current wasm-quarto-hub-client architecture
6009f60 to
2db6f1e
Compare
|
Split this PR — the wasm-qmd-parser cleanup and workflow modernization are now in #125. This PR is just the cfg guard fix (removing the |
|
Thanks @cderv! I've gone back and verified that adding |
# Conflicts: # .beads/issues.jsonl
…artonomy Replace the synthetic Morton-in-identity scheme (which crammed a whole multi-level tile path into one u16 and nibble-walked it back — bad addressing) with the deterministic tier model: each HHTL tier is one 8:8 [container:identity] pair = [mixin-node : instance-on-it], 256×256 = 64k per tier. The high byte names the KIND mixin node (Organ/Chamber/Wall/ Tissue/Cell — the family things attach on), the low byte the instance. HEEL [Organ:Heart] HIP [Chamber:id] TWIG [Wall:id] LEAF [Tissue:id] family [Cell:id] The non-zero tiers ARE the partonomy path, so the address says where a node sits — no Morton decode, no edge lookup. This is the q2 Cascade reading of OGAR PR quarto-dev#116's [container:member] tier model (OGAR's skeleton is the Located/spatial sibling). Mirrors OGAR's [bodypart:bone] LeafTile and supersedes the 12+4 EdgeBlock with family-node grouping (the container byte = the mixin/family node). classid stays 0x0A01 = anatomical_structure in OGAR's ConceptDomain::Anatomy. decodeSoa now exposes the five tiers (heel/hip/twig/leaf/family); FmaGraph lays out straight from them (tierPos: y = depth, x = nested slot under the parent's instance) instead of the Morton treemap — so the HHTL block is finally load-bearing, not write-only ornamentation. Verified: the cockpit's read offsets match the Rust-written GUID byte for byte across organ→chamber→wall→tissue→cell; ceiling sentinel intact; cockpit tsc clean. Browser render not exercised (no browser here). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TzqvDqbFRzyx17EkLKBoZF
Design spec (claude-notes/designs/2026-04-03-wasm-testing-and-cleanup.md) and plan (claude-notes/plans/2026-04-07-wasm-testing-and-cleanup.md) for replacing the lost cfg-proxy coverage (removed in #116) with real wasm32 smoke tests. Incorporates design-review findings: wasm-bindgen-cli version pinning via cargo xtask dev-setup, the C toolchain prerequisite, and Linux-CI-only scope (skipped on Windows).
The
#[cfg(any(target_arch = "wasm32", test))]pattern infilter.rsandshortcode.rsforced native tests through the WASM-restricted Lua stdlib.This caused Windows test failures because the restricted stdlib (no io/os/debug)
doesn't work with Lua's C implementation on native targets.
Fix
Remove the
testarm from the cfg guards so native tests useLua::new()withthe full stdlib. WASM coverage is provided by dedicated WASM tests in CI.
Also marks the
dofile_wasm::test_dofile_script_dir_stacktest as#[cfg_attr(not(target_arch = "wasm32"), ignore)]since it depends onregister_wasm_dofilewhich is only available in the WASM build.Changed files
crates/pampa/src/lua/filter.rs— cfg guard fixcrates/pampa/src/lua/shortcode.rs— cfg guard fixcrates/pampa/src/lua/dofile_wasm.rs— ignore test on native.claude/rules/wasm.md— document the prohibited cfg patternclaude-notes/instructions/testing.md— update testing docsdev-docs/wasm.md— update WASM architecture docs