refactor(entrypoint): build single non-flavored variant, drop pointer dispatch - #424
Draft
vporoshok wants to merge 1 commit into
Draft
refactor(entrypoint): build single non-flavored variant, drop pointer dispatch#424vporoshok wants to merge 1 commit into
vporoshok wants to merge 1 commit into
Conversation
… dispatch Instead of building three amd64 flavors (k8/nehalem/haswell) with objcopy symbol prefixing and selecting one at runtime via function pointers, build a single baseline variant (amd64 k8, arm64 armv8-a) and link its symbols directly. This speeds up the build (one variant instead of three) and removes the extra indirect call per entrypoint function. - Remove the generated init layer: entrypoint.cpp.template, entrypoint.cpp.mk, entrypoint.h.template, and the entrypoint_init/entrypoint_init_aio BUILD targets. - Restore jemalloc's own constructor (drop 0002-manual-init.patch); the manual init existed only for runtime flavor selection, which no longer applies. - Move prompp_get_flavor into bridge/common.cpp as a compile-time constant. - build.mk/Makefile now build and install one *_entrypoint_aio_*.a archive. - cgo LDFLAGS link the single archive per arch/asan/dbg combination. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Instead of building three amd64 flavors (k8/nehalem/haswell) with objcopy symbol prefixing and selecting one at runtime via function pointers, build a single baseline variant (amd64
k8, arm64armv8-a) and link its symbols directly.Benefits:
*_ptrdispatch).Changes
entrypoint.cpp.template,entrypoint.cpp.mk,entrypoint.h.template, and theentrypoint_init/entrypoint_init_aiotargets inpp/BUILD.0002-manual-init.patch(manual init existed only for runtime flavor selection, which no longer applies).prompp_get_flavorintobridge/common.cppas a compile-time constant.build.mk/Makefilebuild and install a single*_entrypoint_aio_*.aarchive.LDFLAGSlink the single archive per arch/asan/dbg combination; regenerateentrypoint.h.Notes
k8is baseline (SSE2, no AVX2/BMI); this supersedes the runtime-dispatch fix in fix(entrypoint): call __builtin_cpu_init before CPU feature detection #423. march can be bumped later viageneric_flavor.armv8-a+crcvariant.Test
pp/entrypointarchive in devcontainer (arm64); jemalloc rebuilt cleanly with its own constructor.go test -tags stringlabels ./pp/go/...all green (incl. cppbridge cgo link against the single archive).ui-buildTypeScript failure is unrelated to this change.Made with Cursor