Skip to content

feat: quality improvements - label checks, CLI flags, duplicate pass removal#4

Merged
0xA672 merged 6 commits into
mainfrom
trae/solo-agent-xXFA8l
Jun 20, 2026
Merged

feat: quality improvements - label checks, CLI flags, duplicate pass removal#4
0xA672 merged 6 commits into
mainfrom
trae/solo-agent-xXFA8l

Conversation

@0xA672

@0xA672 0xA672 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

Quality and robustness improvements:

CLI improvements

  • cmdBuild refactored to use flag.FlagSet for consistent flag parsing
  • Added --linker-arg flag to pass extra args to the linker
  • Added --warn-only flag (registered, TODO: wire to AssembleWithOpt)
  • Updated build help text with new flag documentation

Robustness fixes

  • Undefined label check: Preprocess now checks for referenced but undefined labels after resolving includes and expanding macros
  • Remove duplicate peephole pass: Optimize() already runs peephole twice internally, so the redundant third call in core.go is removed
  • cmdTest temp cleanup: Use defer os.RemoveAll(dir) to ensure temp dir cleanup even on early continue/return

Test improvements

  • VAS_UPDATE_GOLDEN=1 env var enables golden file update mode
  • Fixed latent bug in TestPreprocessBasic where lib.vas was missing lib_func label definition

Cleanup

  • vas/reg.go: New file with unified AllRegs map for core/lint/opt
  • Updated golden files to reflect latest optimizer output
  • gofmt applied to vas/opt/opt.go and vas/reg.go

Tests

All tests pass: go test -short ./... and go test ./...

0xA672 and others added 5 commits June 20, 2026 15:26
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
- hoist all regexp.MustCompile from peephole passes to package-level
  vars (eliminated ~5000 allocations per call)
- replace 13-fold strings.Contains check in hasVirtualRegs with a
  single-pass byte-scanning fast path
- parallelize lint.Rule execution via sync.WaitGroup + goroutines
  when source has 64+ lines; sequential fast path for small inputs
- deduplicate register lookup maps (regTo32/regTo64)
- sort violation results by line number for deterministic output
- optimize xorMovElim to avoid per-line regex compilation (prefix match)
- remove dead regex variables from opt.go
…emoval

Quality and robustness improvements across the codebase:

CLI improvements:
- cmdBuild refactored to use flag.FlagSet for consistent flag parsing
- Added --linker-arg flag to pass extra args to the linker
- Added --warn-only flag (registered, TODO: wire to AssembleWithOpt)
- Updated buildHelpText with new flag documentation

Robustness fixes:
- Undefined label check in prep: Preprocess now checks for referenced but
  undefined labels after resolving includes and expanding macros
- Remove duplicate PeepholeOnly call: Optimize() already runs peephole
  twice internally, so the redundant third call in core.go is removed
- cmdTest: use defer os.RemoveAll(dir) to ensure temp dir cleanup
  even on early continue/return in the test loop

Test improvements:
- VAS_UPDATE_GOLDEN=1 env var enables golden file update mode
- TestPreprocessBasic: fixed latent bug where lib.vas was missing
  lib_func label definition that was referenced in test source

Bug fixes:
- Fixed prep_test.go test fixture to define the lib_func label
  that was being CALLed

Cleanup:
- vas/reg.go: new file with unified AllRegs map for core/lint/opt
- Updated golden files to reflect latest optimizer output
- gofmt applied to vas/opt/opt.go and vas/reg.go
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
@0xA672 0xA672 merged commit 5bc797a into main Jun 20, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Vas Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant