Repository navigation
Conversation
Direct backend lowering diagnostics reported a generic "direct backend local type is unsupported" message regardless of the actual target, even though the expected and help fields already named the target. Substitute the generic "direct backend " prefix with a target-specific label (COFF x64, ELF64, AArch64 Mach-O, x86_64 Mach-O, COFF AArch64, AArch64 ELF) when the message originates from IR lowering. Cover the new behavior with regression tests for the linux-musl-x64, win32-x64.exe, and darwin-x64 targets in the owned-drop-direct-backend-unsupported fixture. Co-Authored-By: Zippy AI <tomkinsbale@icloud.com>
|
@TumCucTom is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
…ring-diagnostics # Conflicts: # scripts/compiler-metrics.mts
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Direct backend lowering diagnostics reported a generic
direct backend local type is unsupportedmessage regardless of theactual target, even though the
expectedandhelpfields alreadynamed the target correctly. The fix substitutes the generic
direct backendprefix with a target-specific label(COFF x64, ELF64, AArch64 Mach-O, x86_64 Mach-O, COFF AArch64,
AArch64 ELF) when the IR lowering message is wrapped into a
buildability diagnostic.
The bug was originally surfaced as part of the agent-surface
repros in #68, where the message stayed target-blind in spite of
the target-correct
expectedandhelpstrings. The agent-surfaceclassification for the
owned-drop-direct-backend-unsupportedfixture already called out "keep backend diagnostics target-correct"
as a follow-up.
Changes
z_direct_backend_target_labelhelper intarget_backend.c.init_lowering_backend_diag(the message-rewrite sitehit by the
targetReadinessJSON for lowering blockers) and inz_build_diag(thez_direct_buildability_checkfunnel).direct backendprefix untouched so callers that already pass a target-aware
message are unaffected.
scripts/compiler-metrics.mtstocover the new helper and the rewritten branch.
conformance/run.mjscoveringlinux-musl-x64,win32-x64.exe, anddarwin-x64against theexisting
owned-drop-direct-backend-unsupported.0fixture, soa future regression to the generic prefix fails conformance.
Verification
./.zero/bin/zero check --json --emit obj --target <tgt> conformance/agent-surface/fixtures/owned-drop-direct-backend-unsupported.0forlinux-musl-x64,linux-x64,linux-musl-arm64,win32-x64.exe,darwin-x64,darwin-arm64now reportsdirect ELF64 local type is unsupported,direct ELF64 local type is unsupported,direct AArch64 ELF local type is unsupported,direct COFF x64 local type is unsupported,direct x86_64 Mach-O local type is unsupported, anddirect AArch64 Mach-O local type is unsupportedrespectively.node --experimental-strip-types --disable-warning=ExperimentalWarning scripts/compiler-metrics.mtsreports zero budget violations.ZERO_NATIVE_TEST_ALLOW_LOCAL=1 node conformance/run.mjsreportsconformance ok, including the new target-aware message assertions.Out of scope
The same generic prefix is also used in
emit_*.cfiles(
emit_elf64.c,emit_coff.c,emit_macho64.c, ...) thatreport
CGEN004from the emit layer. Those code paths are onlyhit if buildability passes and emission later fails, which is a
different surface than the agent-surface fixture. They are not
covered here to keep the change scoped to the buildability path
that the user-visible diagnostic flows through today.