Reorganize upb file structure

This change moves almost everything in the `upb/` directory up one level, so
that for example `upb/upb/generated_code_support.h` becomes just
`upb/generated_code_support.h`. The only exceptions I made to this were that I
left `upb/cmake` and `upb/BUILD` where they are, mostly because that avoids
conflict with other files and the current locations seem reasonable for now.

The `python/` directory is a little bit of a challenge because we had to merge
the existing directory there with `upb/python/`. I made `upb/python/BUILD` into
the BUILD file for the merged directory, and it effectively loads the contents
of the other BUILD file via `python/build_targets.bzl`, but I plan to clean
this up soon.

PiperOrigin-RevId: 568651768
diff --git a/.github/BUILD.bazel b/.github/BUILD.bazel
index 12daec4..3f37e2d 100644
--- a/.github/BUILD.bazel
+++ b/.github/BUILD.bazel
@@ -6,26 +6,29 @@
 # of Xcode.
 xcode_version(
     name = "version14_2_14C18",
-    version = "14.2.14C18",
     aliases = ["14C18"],
     default_ios_sdk_version = "16.2",
-    default_tvos_sdk_version = "16.1",
     default_macos_sdk_version = "13.1",
+    default_tvos_sdk_version = "16.1",
     default_watchos_sdk_version = "9.1",
+    version = "14.2.14C18",
 )
 
 xcode_version(
     name = "version14_1_0_14B47b",
-    version = "14.1.0.14B47b",
     aliases = ["14B47b"],
     default_ios_sdk_version = "16.1",
-    default_tvos_sdk_version = "16.1",
     default_macos_sdk_version = "13.0",
+    default_tvos_sdk_version = "16.1",
     default_watchos_sdk_version = "9.1",
+    version = "14.1.0.14B47b",
 )
 
 xcode_config(
     name = "host_xcodes",
-    versions = [":version14_2_14C18", ":version14_1_0_14B47b"],
     default = ":version14_1_0_14B47b",
+    versions = [
+        ":version14_2_14C18",
+        ":version14_1_0_14B47b",
+    ],
 )
diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml
index 1b6cbd3..e207ee3 100644
--- a/.github/workflows/test_python.yml
+++ b/.github/workflows/test_python.yml
@@ -20,7 +20,7 @@
         version: ["3.8", "3.9", "3.10", "3.11" ]
         include:
           - type: Pure
-            targets: //python/... //upb/python/... //python:python_version_test
+            targets: //python/... //python:python_version_test
             flags: --define=use_fast_cpp_protos=false
           - type: C++
             targets: //python/... //python:python_version_test
@@ -46,6 +46,7 @@
           credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
           bazel-cache: python_linux/${{ matrix.type }}_${{ matrix.version }}
           bazel: test ${{ matrix.targets }} ${{ matrix.flags }} --test_env=KOKORO_PYTHON_VERSION
+          exclude-targets: -//python/pb_unit_tests/...
 
 
   macos:
@@ -57,7 +58,7 @@
         version: [ "3.11" ]
         include:
           - type: Pure
-            targets: //python/... //upb/python/... //python:python_version_test
+            targets: //python/... //python:python_version_test
           - type: C++
             targets: //python/... //python:python_version_test
             flags: --define=use_fast_cpp_protos=true
@@ -95,3 +96,4 @@
             test ${{ matrix.targets }} ${{ matrix.flags }}
             --test_env=KOKORO_PYTHON_VERSION=${{ matrix.version }}
             --macos_minimum_os=10.9
+          exclude-targets: -//python/pb_unit_tests/...
diff --git a/.github/workflows/test_upb.yml b/.github/workflows/test_upb.yml
index 0139a29..0412546 100644
--- a/.github/workflows/test_upb.yml
+++ b/.github/workflows/test_upb.yml
@@ -20,9 +20,9 @@
           - { name: "Fastbuild" }
           - { name: "Optimized", flags: "-c opt" }
           - { name: "FastTable", flags: "--//upb:fasttable_enabled=true" }
-          - { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-//upb/benchmarks:benchmark -//upb/python/..." }
-          - { name: "UBSAN", flags: "--config=ubsan -c dbg", exclude-targets: "-//upb/benchmarks:benchmark -//upb/python/... -//upb/lua/..." }
-          - { name: "32-bit", flags: "--copt=-m32 --linkopt=-m32", exclude-targets: "-//upb/benchmarks:benchmark -//upb/python/..." }
+          - { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-//benchmarks:benchmark -//python/..." }
+          - { name: "UBSAN", flags: "--config=ubsan -c dbg", exclude-targets: "-//benchmarks:benchmark -//python/... -//lua/..." }
+          - { name: "32-bit", flags: "--copt=-m32 --linkopt=-m32", exclude-targets: "-//benchmarks:benchmark -//python/..." }
           # TODO: b/297027295 - Add 32-bit ASAN test
 
     name: ${{ matrix.config.name }}
@@ -39,7 +39,7 @@
           image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize@sha256:04cd765285bc52cbbf51d66c8c66d8603579cf0f19cc42df26b09d2c270541fb
           credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
           bazel-cache: upb-bazel
-          bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //upb/... ${{ matrix.config.flags }}
+          bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upbc/... ${{ matrix.config.flags }}
           exclude-targets: ${{ matrix.config.exclude-targets }}
 
   linux-gcc:
@@ -58,7 +58,7 @@
           image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:12.2-6.3.0-63dd26c0c7a808d92673a3e52e848189d4ab0f17"
           credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
           bazel-cache: "upb-bazel-gcc"
-          bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -c opt //upb/...
+          bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -c opt //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upbc/...
 
   windows:
     strategy:
@@ -75,7 +75,8 @@
         with:
           credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
           bazel-cache: "upb-bazel-windows"
-          bazel: test --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 //upb/upb/... //upb/upbc/... //upb/python/... //upb/protos/... //upb/protos_generator/...
+          bazel: test --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 //upb/... //upbc/... //python/... //protos/... //protos_generator/...
+          exclude-targets: -//python:conformance_test -//upb:def_builder_test
 
   macos:
     strategy:
@@ -96,7 +97,7 @@
         with:
           credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
           bazel-cache: "upb-bazel-macos"
-          bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} //upb/...
+          bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upbc/...
 
   no-python:
     strategy:
@@ -118,7 +119,7 @@
             which python3 &&
             mv `which python3` /tmp &&
             ! which python3 &&
-            bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //upb/python/... -- -//upb/python/dist:source_wheel
+            bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //python/... -- -//python/dist:source_wheel
 
   build_wheels:
     name: Build Wheels
@@ -135,7 +136,7 @@
           image: us-docker.pkg.dev/protobuf-build/release-containers/linux/apple@sha256:b3dc9b75d8e599b0e95ed245d89f44b5a4231112f975da89dd02006a484a58df
           credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
           bazel-cache: upb-bazel-python
-          bazel: build --crosstool_top=//toolchain:clang_suite --//toolchain:release=true --symlink_prefix=/ -c dbg //upb/python/dist //upb/python/dist:test_wheel //upb/python/dist:source_wheel
+          bazel: build --crosstool_top=//toolchain:clang_suite --//toolchain:release=true --symlink_prefix=/ -c dbg //python/dist //python/dist:test_wheel //python/dist:source_wheel
       - name: Move Wheels
         run: mkdir wheels && find _build/out \( -name 'protobuf*.whl' -o -name 'protobuf-*.tar.gz' \) -exec mv '{}' wheels ';'
       - uses: actions/upload-artifact@v3
@@ -146,7 +147,7 @@
         with:
           name: requirements
           # Tests shouldn't have access to the whole upb repo, upload the one file we need
-          path: upb/python/requirements.txt
+          path: python/requirements.txt
 
   test_wheels:
     name: Test Wheels
diff --git a/BUILD.bazel b/BUILD.bazel
index dddb586..23efee4 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,9 +1,9 @@
 # Bazel (https://bazel.build/) BUILD file for Protobuf.
 
 load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library")
+load("@rules_java//java:defs.bzl", "java_lite_proto_library", "java_proto_library")
 load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
 load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
-load("@rules_java//java:defs.bzl", "java_lite_proto_library", "java_proto_library")
 load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS")
 load(":protobuf.bzl", "internal_objc_proto_library", "internal_php_proto_library", "internal_py_proto_library", "internal_ruby_proto_library")
 
@@ -153,8 +153,8 @@
 internal_ruby_proto_library(
     name = "well_known_ruby_protos",
     srcs = [":well_known_protos"],
-    includes = ["src"],
     default_runtime = "",
+    includes = ["src"],
     visibility = [
         "//conformance:__pkg__",
         "//ruby:__subpackages__",
@@ -182,14 +182,14 @@
 cc_binary(
     name = "protoc_static",
     copts = COPTS,
-    linkopts = LINK_OPTS,
     features = select({
-      # This isn't possible on mac because there is no static library for lcrt0.o
-      "@platforms//os:osx": [],
-      "//build_defs:config_osx": [],
-      # When cross-compiling we need to statically link all C++ libraries.
-      "//conditions:default": ["fully_static_link"],
+        # This isn't possible on mac because there is no static library for lcrt0.o
+        "@platforms//os:osx": [],
+        "//build_defs:config_osx": [],
+        # When cross-compiling we need to statically link all C++ libraries.
+        "//conditions:default": ["fully_static_link"],
     }),
+    linkopts = LINK_OPTS,
     visibility = ["//visibility:public"],
     deps = ["//src/google/protobuf/compiler:protoc_lib"],
 )
@@ -201,9 +201,9 @@
 # Expose the runtime for the proto_lang_toolchain so that it can also be used in
 # a user-defined proto_lang_toolchain.
 alias(
-  name = "protobuf_nowkt",
-  actual = "//src/google/protobuf:protobuf_nowkt",
-  visibility = ["//visibility:public"],
+    name = "protobuf_nowkt",
+    actual = "//src/google/protobuf:protobuf_nowkt",
+    visibility = ["//visibility:public"],
 )
 
 # The "lite" runtime works for .proto files that specify the option:
@@ -302,13 +302,13 @@
 alias(
     name = "python_srcs",
     actual = "//python:python_srcs",
-    visibility = ["//upb:__subpackages__"],
+    visibility = ["//python:__subpackages__"],
 )
 
 alias(
     name = "python_test_srcs",
     actual = "//python:python_test_srcs",
-    visibility = ["//upb:__subpackages__"],
+    visibility = ["//python:__subpackages__"],
 )
 
 alias(
@@ -545,11 +545,11 @@
         # The above must come first.
         "src",
     ],
-    deps = [":well_known_ruby_protos"],
     visibility = [
         "//conformance:__pkg__",
         "//ruby:__subpackages__",
     ],
+    deps = [":well_known_ruby_protos"],
 )
 
 filegroup(
diff --git a/WORKSPACE b/WORKSPACE
index 6c78cd8..d1d193d 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -107,13 +107,13 @@
     gemfile = "//ruby:Gemfile",
 )
 
-load("//upb/bazel:workspace_deps.bzl", "upb_deps")
+load("//bazel:workspace_deps.bzl", "upb_deps")
 
 upb_deps()
 
 http_archive(
     name = "lua",
-    build_file = "//upb/bazel:lua.BUILD",
+    build_file = "//bazel:lua.BUILD",
     sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b",
     strip_prefix = "lua-5.2.4",
     urls = [
@@ -134,11 +134,11 @@
     urls = ["https://github.com/googleapis/googleapis/archive/30ed2662a85403cbdeb9ea38df1e414a2a276b83.zip"],
     strip_prefix = "googleapis-30ed2662a85403cbdeb9ea38df1e414a2a276b83",
     sha256 = "4dfc28101127d22abd6f0f6308d915d490c4594c0cfcf7643769c446d6763a46",
-    build_file = "//upb/benchmarks:BUILD.googleapis",
+    build_file = "//benchmarks:BUILD.googleapis",
     patch_cmds = ["find google -type f -name BUILD.bazel -delete"],
 )
 
-load("//upb/bazel:system_python.bzl", "system_python")
+load("//bazel:system_python.bzl", "system_python")
 
 system_python(
     name = "system_python",
@@ -149,7 +149,7 @@
 
 pip_parse(
     name = "pip_deps",
-    requirements = "//upb/python:requirements.txt",
+    requirements = "//python:requirements.txt",
 )
 
 load("@pip_deps//:requirements.bzl", "install_deps")
diff --git a/upb/bazel/BUILD b/bazel/BUILD
similarity index 100%
rename from upb/bazel/BUILD
rename to bazel/BUILD
diff --git a/upb/bazel/amalgamate.py b/bazel/amalgamate.py
similarity index 100%
rename from upb/bazel/amalgamate.py
rename to bazel/amalgamate.py
diff --git a/upb/bazel/amalgamation.bzl b/bazel/amalgamation.bzl
similarity index 97%
rename from upb/bazel/amalgamation.bzl
rename to bazel/amalgamation.bzl
index 206dcb5..dd8ddf6 100644
--- a/upb/bazel/amalgamation.bzl
+++ b/bazel/amalgamation.bzl
@@ -54,7 +54,7 @@
         "_amalgamator": attr.label(
             executable = True,
             cfg = "exec",
-            default = "//upb/bazel:amalgamate",
+            default = "//bazel:amalgamate",
         ),
         "prefix": attr.string(
             default = "",
diff --git a/upb/bazel/build_defs.bzl b/bazel/build_defs.bzl
similarity index 100%
rename from upb/bazel/build_defs.bzl
rename to bazel/build_defs.bzl
diff --git a/upb/bazel/lua.BUILD b/bazel/lua.BUILD
similarity index 100%
rename from upb/bazel/lua.BUILD
rename to bazel/lua.BUILD
diff --git a/upb/bazel/py_proto_library.bzl b/bazel/py_proto_library.bzl
similarity index 100%
rename from upb/bazel/py_proto_library.bzl
rename to bazel/py_proto_library.bzl
diff --git a/upb/bazel/python_downloads.bzl b/bazel/python_downloads.bzl
similarity index 94%
rename from upb/bazel/python_downloads.bzl
rename to bazel/python_downloads.bzl
index 28677c1..5ddac20 100644
--- a/upb/bazel/python_downloads.bzl
+++ b/bazel/python_downloads.bzl
@@ -39,7 +39,7 @@
     hdrs = glob(["**/*.h"]),
     shared_library = "python{0}.dll",
     interface_library = "libs/python{0}.lib",
-    visibility = ["@com_google_protobuf//upb/python:__pkg__"],
+    visibility = ["@com_google_protobuf//python:__pkg__"],
 )
 
 cc_import(
@@ -47,7 +47,7 @@
     hdrs = glob(["**/*.h"]),
     shared_library = "python{1}.dll",
     interface_library = "libs/python{1}.lib",
-    visibility = ["@com_google_protobuf//upb/python:__pkg__"],
+    visibility = ["@com_google_protobuf//python:__pkg__"],
 )
 """
 
diff --git a/upb/bazel/system_python.bzl b/bazel/system_python.bzl
similarity index 100%
rename from upb/bazel/system_python.bzl
rename to bazel/system_python.bzl
diff --git a/upb/bazel/upb_c_proto_library.bzl b/bazel/upb_c_proto_library.bzl
similarity index 83%
rename from upb/bazel/upb_c_proto_library.bzl
rename to bazel/upb_c_proto_library.bzl
index e58dffa..8221b7e 100644
--- a/upb/bazel/upb_c_proto_library.bzl
+++ b/bazel/upb_c_proto_library.bzl
@@ -1,9 +1,9 @@
 """upb_c_proto_library() exposes upb's generated C API for protobuf (foo.upb.h)"""
 
-load("//upb/bazel:upb_minitable_proto_library.bzl", "UpbMinitableCcInfo", "upb_minitable_proto_library_aspect")
-load("//upb/bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl")
-load("//upb/bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain")
-load("//upb/bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
+load("//bazel:upb_minitable_proto_library.bzl", "UpbMinitableCcInfo", "upb_minitable_proto_library_aspect")
+load("//bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl")
+load("//bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain")
+load("//bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
 
 UpbWrappedCcInfo = provider(
     "Provider for cc_info for protos",
@@ -34,7 +34,7 @@
         "_gen_upb": attr.label(
             executable = True,
             cfg = "exec",
-            default = "//upb/upbc:protoc-gen-upb_stage1",
+            default = "//upbc:protoc-gen-upb_stage1",
         ),
         "_protoc": attr.label(
             executable = True,
diff --git a/upb/bazel/upb_minitable_proto_library.bzl b/bazel/upb_minitable_proto_library.bzl
similarity index 89%
rename from upb/bazel/upb_minitable_proto_library.bzl
rename to bazel/upb_minitable_proto_library.bzl
index 82ea53d..34bab83 100644
--- a/upb/bazel/upb_minitable_proto_library.bzl
+++ b/bazel/upb_minitable_proto_library.bzl
@@ -1,8 +1,8 @@
 """upb_minitable_proto_library() exposes upb's generated minitables (foo.upb_minitable.h)"""
 
-load("//upb/bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl")
-load("//upb/bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain")
-load("//upb/bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
+load("//bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl")
+load("//bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain")
+load("//bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
 
 UpbMinitableCcInfo = provider(
     "Provider for cc_info for protos",
@@ -46,7 +46,7 @@
         "_gen_upb_minitable": attr.label(
             executable = True,
             cfg = "exec",
-            default = "//upb/upbc:protoc-gen-upb_minitable_stage1",
+            default = "//upbc:protoc-gen-upb_minitable_stage1",
         ),
         "_protoc": attr.label(
             executable = True,
diff --git a/upb/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl
similarity index 85%
rename from upb/bazel/upb_proto_library.bzl
rename to bazel/upb_proto_library.bzl
index b6c0aff..e38444e 100644
--- a/upb/bazel/upb_proto_library.bzl
+++ b/bazel/upb_proto_library.bzl
@@ -11,17 +11,17 @@
 """
 
 load(
-    "//upb/bazel:upb_c_proto_library.bzl",
+    "//bazel:upb_c_proto_library.bzl",
     _UpbWrappedCcInfo = "UpbWrappedCcInfo",
     _upb_c_proto_library = "upb_c_proto_library",
     _upb_c_proto_library_aspect = "upb_c_proto_library_aspect",
 )
 load(
-    "//upb/bazel:upb_proto_library_internal/aspect.bzl",
+    "//bazel:upb_proto_library_internal/aspect.bzl",
     _GeneratedSrcsInfo = "GeneratedSrcsInfo",
 )
 load(
-    "//upb/bazel:upb_proto_reflection_library.bzl",
+    "//bazel:upb_proto_reflection_library.bzl",
     _upb_proto_reflection_library = "upb_proto_reflection_library",
 )
 
diff --git a/upb/bazel/upb_proto_library_internal/aspect.bzl b/bazel/upb_proto_library_internal/aspect.bzl
similarity index 98%
rename from upb/bazel/upb_proto_library_internal/aspect.bzl
rename to bazel/upb_proto_library_internal/aspect.bzl
index f31e29b..d40664e 100644
--- a/upb/bazel/upb_proto_library_internal/aspect.bzl
+++ b/bazel/upb_proto_library_internal/aspect.bzl
@@ -1,8 +1,8 @@
 """Implementation of the aspect that powers the upb_*_proto_library() rules."""
 
 load("@bazel_skylib//lib:paths.bzl", "paths")
-load("//upb/bazel:upb_proto_library_internal/cc_library_func.bzl", "cc_library_func")
-load("//upb/bazel:upb_proto_library_internal/copts.bzl", "UpbProtoLibraryCoptsInfo")
+load("//bazel:upb_proto_library_internal/cc_library_func.bzl", "cc_library_func")
+load("//bazel:upb_proto_library_internal/copts.bzl", "UpbProtoLibraryCoptsInfo")
 
 # begin:github_only
 _is_google3 = False
diff --git a/upb/bazel/upb_proto_library_internal/cc_library_func.bzl b/bazel/upb_proto_library_internal/cc_library_func.bzl
similarity index 100%
rename from upb/bazel/upb_proto_library_internal/cc_library_func.bzl
rename to bazel/upb_proto_library_internal/cc_library_func.bzl
diff --git a/upb/bazel/upb_proto_library_internal/copts.bzl b/bazel/upb_proto_library_internal/copts.bzl
similarity index 100%
rename from upb/bazel/upb_proto_library_internal/copts.bzl
rename to bazel/upb_proto_library_internal/copts.bzl
diff --git a/upb/bazel/upb_proto_library_internal/rule.bzl b/bazel/upb_proto_library_internal/rule.bzl
similarity index 100%
rename from upb/bazel/upb_proto_library_internal/rule.bzl
rename to bazel/upb_proto_library_internal/rule.bzl
diff --git a/upb/bazel/upb_proto_reflection_library.bzl b/bazel/upb_proto_reflection_library.bzl
similarity index 84%
rename from upb/bazel/upb_proto_reflection_library.bzl
rename to bazel/upb_proto_reflection_library.bzl
index 0717bf6..c4d52aa 100644
--- a/upb/bazel/upb_proto_reflection_library.bzl
+++ b/bazel/upb_proto_reflection_library.bzl
@@ -1,9 +1,9 @@
 """upb_c_proto_reflection_library() exposes upb reflection for protobuf (foo.upbdefs.h)"""
 
-load("//upb/bazel:upb_minitable_proto_library.bzl", "UpbMinitableCcInfo", "upb_minitable_proto_library_aspect")
-load("//upb/bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl")
-load("//upb/bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain")
-load("//upb/bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
+load("//bazel:upb_minitable_proto_library.bzl", "UpbMinitableCcInfo", "upb_minitable_proto_library_aspect")
+load("//bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl")
+load("//bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain")
+load("//bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
 
 _UpbDefsWrappedCcInfo = provider("Provider for cc_info for protos", fields = ["cc_info"])
 
@@ -31,7 +31,7 @@
         "_gen_upbdefs": attr.label(
             executable = True,
             cfg = "exec",
-            default = "//upb/upbc:protoc-gen-upbdefs",
+            default = "//upbc:protoc-gen-upbdefs",
         ),
         "_protoc": attr.label(
             executable = True,
diff --git a/upb/bazel/workspace_deps.bzl b/bazel/workspace_deps.bzl
similarity index 97%
rename from upb/bazel/workspace_deps.bzl
rename to bazel/workspace_deps.bzl
index 1f3ccad..14b2fc8 100644
--- a/upb/bazel/workspace_deps.bzl
+++ b/bazel/workspace_deps.bzl
@@ -1,6 +1,6 @@
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
 load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
-load("//upb/bazel:python_downloads.bzl", "python_nuget_package", "python_source_archive")
+load("//bazel:python_downloads.bzl", "python_nuget_package", "python_source_archive")
 
 def _github_archive(repo, commit, **kwargs):
     repo_name = repo.split("/")[-1]
diff --git a/upb/benchmarks/BUILD b/benchmarks/BUILD
similarity index 98%
rename from upb/benchmarks/BUILD
rename to benchmarks/BUILD
index 8839584..07f87a9 100644
--- a/upb/benchmarks/BUILD
+++ b/benchmarks/BUILD
@@ -12,7 +12,7 @@
 # end:google_only
 
 load(
-    "//upb/bazel:upb_proto_library.bzl",
+    "//bazel:upb_proto_library.bzl",
     "upb_proto_library",
     "upb_proto_reflection_library",
 )
@@ -76,6 +76,7 @@
         ":benchmark_descriptor_upb_proto",
         ":benchmark_descriptor_upb_proto_reflection",
         "//:protobuf",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:base_internal",
         "//upb:descriptor_upb_proto",
diff --git a/upb/benchmarks/BUILD.googleapis b/benchmarks/BUILD.googleapis
similarity index 100%
rename from upb/benchmarks/BUILD.googleapis
rename to benchmarks/BUILD.googleapis
diff --git a/upb/benchmarks/benchmark.cc b/benchmarks/benchmark.cc
similarity index 96%
rename from upb/benchmarks/benchmark.cc
rename to benchmarks/benchmark.cc
index 689ff1b..a2e2cc2 100644
--- a/upb/benchmarks/benchmark.cc
+++ b/benchmarks/benchmark.cc
@@ -38,15 +38,15 @@
 #include "google/protobuf/descriptor.pb.h"
 #include "absl/container/flat_hash_set.h"
 #include "google/protobuf/dynamic_message.h"
-#include "upb/benchmarks/descriptor.pb.h"
-#include "upb/benchmarks/descriptor.upb.h"
-#include "upb/benchmarks/descriptor.upbdefs.h"
-#include "upb/benchmarks/descriptor_sv.pb.h"
-#include "upb/upb/base/internal/log2.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/reflection/def.hpp"
+#include "benchmarks/descriptor.pb.h"
+#include "benchmarks/descriptor.upb.h"
+#include "benchmarks/descriptor.upbdefs.h"
+#include "benchmarks/descriptor_sv.pb.h"
+#include "upb/base/internal/log2.h"
+#include "upb/mem/arena.h"
+#include "upb/reflection/def.hpp"
 
-upb_StringView descriptor = upb_benchmarks_descriptor_proto_upbdefinit.descriptor;
+upb_StringView descriptor = benchmarks_descriptor_proto_upbdefinit.descriptor;
 namespace protobuf = ::google::protobuf;
 
 // A buffer big enough to parse descriptor.proto without going to heap.
diff --git a/upb/benchmarks/build_defs.bzl b/benchmarks/build_defs.bzl
similarity index 100%
rename from upb/benchmarks/build_defs.bzl
rename to benchmarks/build_defs.bzl
diff --git a/upb/benchmarks/compare.py b/benchmarks/compare.py
similarity index 100%
rename from upb/benchmarks/compare.py
rename to benchmarks/compare.py
diff --git a/upb/benchmarks/descriptor.proto b/benchmarks/descriptor.proto
similarity index 100%
rename from upb/benchmarks/descriptor.proto
rename to benchmarks/descriptor.proto
diff --git a/upb/benchmarks/descriptor_sv.proto b/benchmarks/descriptor_sv.proto
similarity index 100%
rename from upb/benchmarks/descriptor_sv.proto
rename to benchmarks/descriptor_sv.proto
diff --git a/upb/benchmarks/empty.proto b/benchmarks/empty.proto
similarity index 100%
rename from upb/benchmarks/empty.proto
rename to benchmarks/empty.proto
diff --git a/upb/benchmarks/gen_protobuf_binary_cc.py b/benchmarks/gen_protobuf_binary_cc.py
similarity index 100%
rename from upb/benchmarks/gen_protobuf_binary_cc.py
rename to benchmarks/gen_protobuf_binary_cc.py
diff --git a/upb/benchmarks/gen_synthetic_protos.py b/benchmarks/gen_synthetic_protos.py
similarity index 100%
rename from upb/benchmarks/gen_synthetic_protos.py
rename to benchmarks/gen_synthetic_protos.py
diff --git a/upb/benchmarks/gen_upb_binary_c.py b/benchmarks/gen_upb_binary_c.py
similarity index 100%
rename from upb/benchmarks/gen_upb_binary_c.py
rename to benchmarks/gen_upb_binary_c.py
diff --git a/build_defs/BUILD.bazel b/build_defs/BUILD.bazel
index 0a45eae..ea8fa18 100644
--- a/build_defs/BUILD.bazel
+++ b/build_defs/BUILD.bazel
@@ -89,7 +89,7 @@
     match_any = [
         ":config_win32",
         ":config_win64",
-    ]
+    ],
 )
 
 config_setting(
@@ -107,7 +107,7 @@
     match_any = [
         ":config_osx_aarch64",
         ":config_osx_x86_64",
-    ]
+    ],
 )
 
 # Internal testing:
diff --git a/csharp/compatibility_tests/v3.0.0/BUILD.bazel b/csharp/compatibility_tests/v3.0.0/BUILD.bazel
index 1f6c713..f7c1b26 100644
--- a/csharp/compatibility_tests/v3.0.0/BUILD.bazel
+++ b/csharp/compatibility_tests/v3.0.0/BUILD.bazel
@@ -4,13 +4,13 @@
 inline_sh_test(
     name = "tests",
     srcs = ["test.sh"],
+    cmd = "$(location test.sh) 3.0.0 $(rootpath //:protoc)",
     tools = ["//:protoc"],
     deps = glob([
-      "src/**/*.cs*",  # .cs and .csproj
-      "protos/**/*.proto",
+        "src/**/*.cs*",  # .cs and .csproj
+        "protos/**/*.proto",
     ]) + [
-      "//csharp:srcs",
-      "//:well_known_protos",
+        "//:well_known_protos",
+        "//csharp:srcs",
     ],
-    cmd = "$(location test.sh) 3.0.0 $(rootpath //:protoc)"
 )
diff --git a/docs/design/editions/edition-zero-converged-semantics.md b/docs/design/editions/edition-zero-converged-semantics.md
index 2b9557a..339f180 100644
--- a/docs/design/editions/edition-zero-converged-semantics.md
+++ b/docs/design/editions/edition-zero-converged-semantics.md
@@ -129,7 +129,7 @@
 
 Rev'ing `descriptor.proto` is a far more intrusive change that affects many
 downstream systems. Many systems access descriptors through either a descriptor
-API (for example, `proto2::Descriptor` in C++) or by directly accessing a proto
+API (for example, `google::protobuf::Descriptor` in C++) or by directly accessing a proto
 from `descriptor.proto` (eg. `google.protobuf.DescriptorProto`). Any changes
 here need to be managed much more delicately.
 
diff --git a/docs/design/editions/edition-zero-feature-enum-field-closedness.md b/docs/design/editions/edition-zero-feature-enum-field-closedness.md
index 30e1a62..aea7fca 100644
--- a/docs/design/editions/edition-zero-feature-enum-field-closedness.md
+++ b/docs/design/editions/edition-zero-feature-enum-field-closedness.md
@@ -7,7 +7,7 @@
 ## Background
 
 On 2023-02-10, a CL [@mcy](https://github.com/mcy) submitted to delete
-`proto2::Reflection::SupportsUnknownEnumValue()`. Oddly, this function used the
+`google::protobuf::Reflection::SupportsUnknownEnumValue()`. Oddly, this function used the
 containing message's `syntax`, rather than the enum field's, to determine
 whether the enum was open.
 
diff --git a/upb/docs/design.md b/docs/upb/design.md
similarity index 100%
rename from upb/docs/design.md
rename to docs/upb/design.md
diff --git a/upb/docs/render.py b/docs/upb/render.py
similarity index 100%
rename from upb/docs/render.py
rename to docs/upb/render.py
diff --git a/upb/docs/style-guide.md b/docs/upb/style-guide.md
similarity index 100%
rename from upb/docs/style-guide.md
rename to docs/upb/style-guide.md
diff --git a/upb/docs/vs-cpp-protos.md b/docs/upb/vs-cpp-protos.md
similarity index 100%
rename from upb/docs/vs-cpp-protos.md
rename to docs/upb/vs-cpp-protos.md
diff --git a/upb/docs/wrapping-upb.md b/docs/upb/wrapping-upb.md
similarity index 97%
rename from upb/docs/wrapping-upb.md
rename to docs/upb/wrapping-upb.md
index cefced6..bc1bd63 100644
--- a/upb/docs/wrapping-upb.md
+++ b/docs/upb/wrapping-upb.md
@@ -173,8 +173,8 @@
 
 To use reflection-based access:
 
-1. Load and access descriptor data using the interfaces in upb/upb/reflection/def.h.
-2. Access message data using the interfaces in upb/upb/reflection/message.h.
+1. Load and access descriptor data using the interfaces in upb/reflection/def.h.
+2. Access message data using the interfaces in upb/reflection/message.h.
 
 ### MiniTables
 
@@ -234,8 +234,8 @@
 
 To use MiniTable-based access:
 
-1. Load and access MiniDescriptors data using the interfaces in upb/upb/mini_descriptor/decode.h.
-2. Access message data using the interfaces in upb/upb/message/accessors.h.
+1. Load and access MiniDescriptors data using the interfaces in upb/mini_descriptor/decode.h.
+2. Access message data using the interfaces in upb/message/accessors.h.
 
 ## Memory Management
 
diff --git a/upb/.bazelci/presubmit.yml b/google3/third_party/upb/github/.bazelci/presubmit.yml
similarity index 100%
rename from upb/.bazelci/presubmit.yml
rename to google3/third_party/upb/github/.bazelci/presubmit.yml
diff --git a/upb/.bazelignore b/google3/third_party/upb/github/.bazelignore
similarity index 100%
rename from upb/.bazelignore
rename to google3/third_party/upb/github/.bazelignore
diff --git a/upb/.bazelrc b/google3/third_party/upb/github/.bazelrc
similarity index 100%
rename from upb/.bazelrc
rename to google3/third_party/upb/github/.bazelrc
diff --git a/upb/.clang-format b/google3/third_party/upb/github/.clang-format
similarity index 100%
rename from upb/.clang-format
rename to google3/third_party/upb/github/.clang-format
diff --git a/upb/.gitignore b/google3/third_party/upb/github/.gitignore
similarity index 100%
rename from upb/.gitignore
rename to google3/third_party/upb/github/.gitignore
diff --git a/upb/README.md b/google3/third_party/upb/github/README.md
similarity index 100%
rename from upb/README.md
rename to google3/third_party/upb/github/README.md
diff --git a/java/BUILD.bazel b/java/BUILD.bazel
index 1b45507..14838ae 100644
--- a/java/BUILD.bazel
+++ b/java/BUILD.bazel
@@ -4,11 +4,6 @@
 sh_test(
     name = "linkage_monitor",
     size = "large",
-    tags = [
-        # Exclude this target from wildcard expansion (//...) because it may
-        # take unnecessary time.
-        "manual",
-    ],
     srcs = [
         ":linkage_monitor.sh",
     ],
@@ -28,6 +23,11 @@
         "*/pom.xml",
         "test/linkage-monitor-check-bom/pom.xml",
     ]),
+    tags = [
+        # Exclude this target from wildcard expansion (//...) because it may
+        # take unnecessary time.
+        "manual",
+    ],
 )
 
 test_suite(
diff --git a/java/kotlin/BUILD.bazel b/java/kotlin/BUILD.bazel
index 9814c7a..2d17a71 100644
--- a/java/kotlin/BUILD.bazel
+++ b/java/kotlin/BUILD.bazel
@@ -59,8 +59,8 @@
     maven_coordinates = "com.google.protobuf:protobuf-kotlin:%s" % PROTOBUF_JAVA_VERSION,
     pom_template = "//java/kotlin:pom_template.xml",
     resources = [
-        "//src/google/protobuf:descriptor_proto_srcs",
         "//:well_known_type_protos",
+        "//src/google/protobuf:descriptor_proto_srcs",
     ],
     tags = ["manual"],
     runtime_deps = [
diff --git a/upb/lua/BUILD.bazel b/lua/BUILD.bazel
similarity index 94%
rename from upb/lua/BUILD.bazel
rename to lua/BUILD.bazel
index ba2b156..6216f9c 100644
--- a/upb/lua/BUILD.bazel
+++ b/lua/BUILD.bazel
@@ -6,12 +6,12 @@
 # https://developers.google.com/open-source/licenses/bsd
 
 load(
-    "//upb/bazel:build_defs.bzl",
+    "//bazel:build_defs.bzl",
     "UPB_DEFAULT_COPTS",
     "UPB_DEFAULT_CPPOPTS",
 )
 load(
-    "//upb/lua:lua_proto_library.bzl",
+    "//lua:lua_proto_library.bzl",
     "lua_proto_library",
 )
 
@@ -58,6 +58,7 @@
     copts = UPB_DEFAULT_COPTS,
     data = [
         "test_upb.lua",
+        "upb.lua",
         ":descriptor_proto_lua",
         ":empty_proto_lua",
         ":test_messages_proto2_proto_lua",
@@ -67,11 +68,10 @@
         "//conformance:conformance_proto",
         "//third_party/lunit:console.lua",
         "//third_party/lunit:lunit.lua",
-        "//upb/lua:upb.lua",
     ],
     linkstatic = 1,
     deps = [
-        "//upb/lua:lupb",
+        ":lupb",
         "@lua//:liblua",
     ],
 )
diff --git a/upb/lua/README.md b/lua/README.md
similarity index 100%
rename from upb/lua/README.md
rename to lua/README.md
diff --git a/upb/lua/def.c b/lua/def.c
similarity index 99%
rename from upb/lua/def.c
rename to lua/def.c
index 22e0b9f..9affe52 100644
--- a/upb/lua/def.c
+++ b/lua/def.c
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upb/reflection/def.h"
+#include "upb/reflection/def.h"
 
 #include <float.h>
 #include <math.h>
@@ -36,8 +36,8 @@
 #include <string.h>
 
 #include "lauxlib.h"
-#include "upb/lua/upb.h"
-#include "upb/upb/reflection/message.h"
+#include "lua/upb.h"
+#include "upb/reflection/message.h"
 
 #define LUPB_ENUMDEF "lupb.enumdef"
 #define LUPB_ENUMVALDEF "lupb.enumvaldef"
diff --git a/upb/lua/lua_proto_library.bzl b/lua/lua_proto_library.bzl
similarity index 98%
rename from upb/lua/lua_proto_library.bzl
rename to lua/lua_proto_library.bzl
index d7a741c..579eca1 100644
--- a/upb/lua/lua_proto_library.bzl
+++ b/lua/lua_proto_library.bzl
@@ -109,7 +109,7 @@
         "_upbc": attr.label(
             executable = True,
             cfg = "exec",
-            default = "//upb/lua:protoc-gen-lua",
+            default = "//lua:protoc-gen-lua",
         ),
         "_protoc": attr.label(
             executable = True,
diff --git a/upb/lua/main.c b/lua/main.c
similarity index 94%
rename from upb/lua/main.c
rename to lua/main.c
index a34069d..7f32209 100644
--- a/upb/lua/main.c
+++ b/lua/main.c
@@ -33,7 +33,7 @@
 #include <lualib.h>
 #include <signal.h>
 
-#include "upb/lua/upb.h"
+#include "lua/upb.h"
 
 lua_State* L;
 
@@ -59,14 +59,14 @@
     "bazel-bin/?.lua;"
     "bazel-bin/external/com_google_protobuf/src/?.lua;"
     "bazel-bin/external/com_google_protobuf/?.lua;"
-    "upb/lua/?.lua;"
+    "lua/?.lua;"
     // These additional paths handle the case where this test is invoked from
     // the protobuf repo's Bazel workspace.
-    "external/upb/?.lua;"
-    "external/upb/third_party/lunit/?.lua;"
+    "external/?.lua;"
+    "external/third_party/lunit/?.lua;"
     "src/?.lua;"
-    "bazel-bin/external/upb/?.lua;"
-    "external/upb/lua/?.lua"
+    "bazel-bin/external/?.lua;"
+    "external/lua/?.lua"
     "'";
 
 int main(int argc, char** argv) {
diff --git a/upb/lua/msg.c b/lua/msg.c
similarity index 98%
rename from upb/lua/msg.c
rename to lua/msg.c
index ab48739..bdec7a2 100644
--- a/upb/lua/msg.c
+++ b/lua/msg.c
@@ -39,14 +39,14 @@
 #include <string.h>
 
 #include "lauxlib.h"
-#include "upb/lua/upb.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/json/decode.h"
-#include "upb/upb/json/encode.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/port/def.inc"
-#include "upb/upb/reflection/message.h"
-#include "upb/upb/text/encode.h"
+#include "lua/upb.h"
+#include "upb/collections/map.h"
+#include "upb/json/decode.h"
+#include "upb/json/encode.h"
+#include "upb/message/message.h"
+#include "upb/port/def.inc"
+#include "upb/reflection/message.h"
+#include "upb/text/encode.h"
 
 /*
  * Message/Map/Array objects.  These objects form a directed graph: a message
diff --git a/upb/lua/test.proto b/lua/test.proto
similarity index 100%
rename from upb/lua/test.proto
rename to lua/test.proto
diff --git a/upb/lua/test_upb.lua b/lua/test_upb.lua
similarity index 99%
rename from upb/lua/test_upb.lua
rename to lua/test_upb.lua
index 416fdc7..8ebf82b 100644
--- a/upb/lua/test_upb.lua
+++ b/lua/test_upb.lua
@@ -34,7 +34,7 @@
 
 local upb = require "lupb"
 local lunit = require "lunit"
-local upb_test = require "upb.lua.test_pb"
+local upb_test = require "lua.test_pb"
 local test_messages_proto3 = require "google.protobuf.test_messages_proto3_pb"
 local test_messages_proto2 = require "google.protobuf.test_messages_proto2_pb"
 local descriptor = require "google.protobuf.descriptor_pb"
diff --git a/upb/lua/upb.c b/lua/upb.c
similarity index 99%
rename from upb/lua/upb.c
rename to lua/upb.c
index 07dc3f3..4500fb4 100644
--- a/upb/lua/upb.c
+++ b/lua/upb.c
@@ -50,7 +50,7 @@
  * domain of [u]int64 values.
  */
 
-#include "upb/lua/upb.h"
+#include "lua/upb.h"
 
 #include <float.h>
 #include <math.h>
@@ -59,7 +59,7 @@
 #include <string.h>
 
 #include "lauxlib.h"
-#include "upb/upb/message/message.h"
+#include "upb/message/message.h"
 
 /* Lua compatibility code *****************************************************/
 
diff --git a/upb/lua/upb.h b/lua/upb.h
similarity index 97%
rename from upb/lua/upb.h
rename to lua/upb.h
index 59a4ffe..46ec911 100644
--- a/upb/lua/upb.h
+++ b/lua/upb.h
@@ -36,9 +36,9 @@
 #define UPB_LUA_UPB_H_
 
 #include "lauxlib.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/message.h"
+#include "upb/message/message.h"
+#include "upb/reflection/def.h"
+#include "upb/reflection/message.h"
 
 /* Lua changes its API in incompatible ways in every minor release.
  * This is some shim code to paper over the differences. */
diff --git a/upb/lua/upb.lua b/lua/upb.lua
similarity index 100%
rename from upb/lua/upb.lua
rename to lua/upb.lua
diff --git a/upb/lua/upbc.cc b/lua/upbc.cc
similarity index 100%
rename from upb/lua/upbc.cc
rename to lua/upbc.cc
diff --git a/objectivec/BUILD.bazel b/objectivec/BUILD.bazel
index 70727cc..cb0d7c8 100644
--- a/objectivec/BUILD.bazel
+++ b/objectivec/BUILD.bazel
@@ -42,8 +42,8 @@
         for wkt in _OBJC_WKT_NAMES
         for ext in _OBJC_EXTS
     ]),
-    tools = ["//:protoc"],
     tags = ["manual"],
+    tools = ["//:protoc"],
 )
 
 staleness_test(
diff --git a/php/BUILD.bazel b/php/BUILD.bazel
index 966b3e2..345d1ab 100644
--- a/php/BUILD.bazel
+++ b/php/BUILD.bazel
@@ -2,7 +2,7 @@
 #
 # See also code generation logic under /src/google/protobuf/compiler/php.
 
-load("@rules_pkg//:mappings.bzl", "pkg_files", "pkg_filegroup", "strip_prefix")
+load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix")
 load("@rules_pkg//:pkg.bzl", "pkg_tar")
 load("//upb/cmake:build_defs.bzl", "staleness_test")
 load("//build_defs:internal_shell.bzl", "inline_sh_binary")
@@ -11,10 +11,6 @@
 
 filegroup(
     name = "source_files",
-    visibility = [
-        "//conformance:__pkg__",
-        "//php:__pkg__",
-    ],
     srcs = glob([
         "src/GPBMetadata/Google/Protobuf/**/*.php",
         "src/Google/Protobuf/**/*.php",
@@ -22,6 +18,10 @@
         "composer.json",
         ":php_ext_source_files",
     ],
+    visibility = [
+        "//conformance:__pkg__",
+        "//php:__pkg__",
+    ],
 )
 
 ################################################################################
@@ -48,12 +48,12 @@
         ":source_files",
         "@utf8_range//:utf8_range_srcs",
     ],
-    tools = [":build_extension"],
     outs = ["protobuf.so"],
     cmd = """
         ./$(execpath :build_extension) $@
         cp php/ext/google/protobuf/modules/protobuf.so $(OUTS)
     """,
+    tools = [":build_extension"],
     visibility = ["//visibility:public"],
 )
 
@@ -64,23 +64,23 @@
 conformance_test(
     name = "conformance_test",
     failure_list = "//conformance:failure_list_php.txt",
-    testee = "//conformance:conformance_php",
-    text_format_failure_list = "//conformance:text_format_failure_list_php.txt",
     target_compatible_with = select({
         "@platforms//os:osx": ["@platforms//:incompatible"],
         "//conditions:default": [],
     }),
+    testee = "//conformance:conformance_php",
+    text_format_failure_list = "//conformance:text_format_failure_list_php.txt",
 )
 
 conformance_test(
     name = "conformance_test_c",
     failure_list = "//conformance:failure_list_php_c.txt",
-    testee = "//conformance:conformance_php_c",
-    text_format_failure_list = "//conformance:text_format_failure_list_php.txt",
     target_compatible_with = select({
         "@platforms//os:osx": [],
         "//conditions:default": ["@platforms//:incompatible"],
     }),
+    testee = "//conformance:conformance_php_c",
+    text_format_failure_list = "//conformance:text_format_failure_list_php.txt",
 )
 
 genrule(
@@ -100,8 +100,8 @@
 staleness_test(
     name = "test_amalgamation_staleness",
     outs = [
-        "ext/google/protobuf/php-upb.h",
         "ext/google/protobuf/php-upb.c",
+        "ext/google/protobuf/php-upb.h",
     ],
     generated_pattern = "generated-in/%s",
     tags = ["manual"],
@@ -121,7 +121,6 @@
         "tests/proto/**/*.proto",
         "tests/proto_previous/*.proto",
     ]) + [
-        ":source_files",
         "BUILD.bazel",
         "README.md",
         "REFCOUNTING.md",
@@ -131,6 +130,7 @@
         "release.sh",
         "src/phpdoc.dist.xml",
         "tests/valgrind.supp",
+        ":source_files",
     ],
     prefix = "php",
     strip_prefix = strip_prefix.from_pkg(""),
@@ -142,71 +142,71 @@
 ################################################################################
 
 pkg_files(
-  name = "php_ext_source_files",
-  srcs = glob([
-    "ext/google/protobuf/*.h",
-    "ext/google/protobuf/*.c",
-  ]) + [
-    "//:LICENSE",
-    "ext/google/protobuf/config.m4",
-    "ext/google/protobuf/config.w32",
-    "ext/google/protobuf/wkt.inc",
-  ],
+    name = "php_ext_source_files",
+    srcs = glob([
+        "ext/google/protobuf/*.h",
+        "ext/google/protobuf/*.c",
+    ]) + [
+        "ext/google/protobuf/config.m4",
+        "ext/google/protobuf/config.w32",
+        "ext/google/protobuf/wkt.inc",
+        "//:LICENSE",
+    ],
 )
 
 pkg_files(
-  name = "utf8_range_files",
-  srcs = [
-    "@utf8_range//:utf8_range_srcs",
-    "@utf8_range//:LICENSE",
-  ],
-  prefix = "third_party/utf8_range",
+    name = "utf8_range_files",
+    srcs = [
+        "@utf8_range//:LICENSE",
+        "@utf8_range//:utf8_range_srcs",
+    ],
+    prefix = "third_party/utf8_range",
 )
 
 pkg_filegroup(
-  name = "pecl_release_files",
-  srcs = [
-    ":php_ext_source_files",
-    ":utf8_range_files",
-  ],
-  prefix = "protobuf-%s" % PROTOBUF_PHP_VERSION,
+    name = "pecl_release_files",
+    srcs = [
+        ":php_ext_source_files",
+        ":utf8_range_files",
+    ],
+    prefix = "protobuf-%s" % PROTOBUF_PHP_VERSION,
 )
 
 # PECL .tgz without package.xml
 pkg_tar(
-  name = "release_without_package",
-  extension = "tgz",
-  srcs = [
-    ":pecl_release_files",
-  ],
-  out = "release_without_package.tgz",
+    name = "release_without_package",
+    srcs = [
+        ":pecl_release_files",
+    ],
+    out = "release_without_package.tgz",
+    extension = "tgz",
 )
 
 # Generate PECL package.xml
 genrule(
     name = "generate_package_xml",
     srcs = [
-      ":release_without_package",
-      "ext/google/protobuf/template_package.xml",
+        ":release_without_package",
+        "ext/google/protobuf/template_package.xml",
     ],
     outs = ["package.xml"],
     cmd = " ".join([
-      "$(location ext/google/protobuf/generate_package_xml.sh)",
-      "$(location ext/google/protobuf/template_package.xml)",
-      PROTOBUF_PHP_VERSION,
-      PROTOC_VERSION,
-      "$$(tar -tf $(location :release_without_package) | sed -z -e 's;\\n;,;g')",
-      "$(location package.xml)"
+        "$(location ext/google/protobuf/generate_package_xml.sh)",
+        "$(location ext/google/protobuf/template_package.xml)",
+        PROTOBUF_PHP_VERSION,
+        PROTOC_VERSION,
+        "$$(tar -tf $(location :release_without_package) | sed -z -e 's;\\n;,;g')",
+        "$(location package.xml)",
     ]),
     tools = ["ext/google/protobuf/generate_package_xml.sh"],
 )
 
 pkg_tar(
-  name = "release",
-  extension = "tgz",
-  srcs = [
-    ":pecl_release_files",
-    ":generate_package_xml",
-  ],
-  out = "protobuf-%s.tgz" % PROTOBUF_PHP_VERSION,
+    name = "release",
+    srcs = [
+        ":generate_package_xml",
+        ":pecl_release_files",
+    ],
+    out = "protobuf-%s.tgz" % PROTOBUF_PHP_VERSION,
+    extension = "tgz",
 )
diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel
index 936edad..1d24e44 100644
--- a/pkg/BUILD.bazel
+++ b/pkg/BUILD.bazel
@@ -234,10 +234,10 @@
     ],
     tags = ["manual"],
     deps = [
+        "//src/google/protobuf:internal_visibility_for_testing",
         "//src/google/protobuf:test_textproto",
         "//src/google/protobuf/compiler:command_line_interface_tester",
         "//src/google/protobuf/compiler:mock_code_generator",
         "//src/google/protobuf/testing",
-        "//src/google/protobuf:internal_visibility_for_testing",
     ],
 )
diff --git a/upb/protos/BUILD b/protos/BUILD
similarity index 91%
rename from upb/protos/BUILD
rename to protos/BUILD
index 67029e4..648d938 100644
--- a/upb/protos/BUILD
+++ b/protos/BUILD
@@ -6,11 +6,11 @@
 # https://developers.google.com/open-source/licenses/bsd
 
 load(
-    "//upb/bazel:build_defs.bzl",
+    "//bazel:build_defs.bzl",
     "UPB_DEFAULT_CPPOPTS",
 )
 load(
-    "//upb/protos/bazel:upb_cc_proto_library.bzl",
+    "//protos/bazel:upb_cc_proto_library.bzl",
     "upb_cc_proto_library_copts",
 )
 
@@ -133,10 +133,10 @@
     copts = UPB_DEFAULT_CPPOPTS,
     deps = [
         ":protos_internal",
-        "//upb:mem",
-        "//upb/protos_generator/tests:test_model_upb_cc_proto",
-        "//upb/protos_generator/tests:test_model_upb_proto",
         "@com_google_googletest//:gtest_main",
+        "//upb:mem",
+        "//protos_generator/tests:test_model_upb_cc_proto",
+        "//protos_generator/tests:test_model_upb_proto",
     ],
 )
 
@@ -159,12 +159,12 @@
     name = "protos_extension_lock_test",
     srcs = ["protos_extension_lock_test.cc"],
     deps = [
+        "@com_google_googletest//:gtest_main",
         "//upb:mem",
-        "//upb/protos",
-        "//upb/protos:protos_extension_lock",
-        "//upb/protos_generator/tests:test_model_upb_cc_proto",
+        "//protos",
+        "//protos:protos_extension_lock",
+        "//protos_generator/tests:test_model_upb_cc_proto",
         "@com_google_absl//absl/hash",
         "@com_google_absl//absl/log:absl_check",
-        "@com_google_googletest//:gtest_main",
     ],
 )
diff --git a/protos/README.md b/protos/README.md
new file mode 100644
index 0000000..dc09201
--- /dev/null
+++ b/protos/README.md
@@ -0,0 +1,7 @@
+`protos` C++ API
+===============
+
+`protos` is a C++ protobuf implementation backed by μpb, introduced in 2022.
+The API is currently experimental and may undergo incompatible changes without
+notice. The supported C++ implementation is
+[here](https://github.com/protocolbuffers/protobuf/tree/main/src).
diff --git a/upb/protos/bazel/BUILD b/protos/bazel/BUILD
similarity index 93%
rename from upb/protos/bazel/BUILD
rename to protos/bazel/BUILD
index 83e2840..ea91541 100644
--- a/upb/protos/bazel/BUILD
+++ b/protos/bazel/BUILD
@@ -18,8 +18,8 @@
     srcs = ["upb_cc_proto_library.bzl"],
     visibility = ["//visibility:public"],
     deps = [
-        "//upb/bazel:upb_proto_library_bzl",
         "@bazel_skylib//lib:paths",
+        "//bazel:upb_proto_library_bzl",
         "@bazel_tools//tools/cpp:toolchain_utils.bzl",
     ],
 )
diff --git a/upb/protos/bazel/upb_cc_proto_library.bzl b/protos/bazel/upb_cc_proto_library.bzl
similarity index 94%
rename from upb/protos/bazel/upb_cc_proto_library.bzl
rename to protos/bazel/upb_cc_proto_library.bzl
index 859a0d8..b59ae65 100644
--- a/upb/protos/bazel/upb_cc_proto_library.bzl
+++ b/protos/bazel/upb_cc_proto_library.bzl
@@ -10,7 +10,7 @@
 """
 
 load("@bazel_skylib//lib:paths.bzl", "paths")
-load("//upb/bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect")
+load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect")
 
 # begin:google_only
 # load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
@@ -229,12 +229,12 @@
 _upb_cc_proto_library_aspect = aspect(
     attrs = {
         "_ccopts": attr.label(
-            default = "//upb/protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use",
+            default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use",
         ),
         "_gen_upbprotos": attr.label(
             executable = True,
             cfg = "exec",
-            default = "//upb/protos_generator:protoc-gen-upb-protos",
+            default = "//protos_generator:protoc-gen-upb-protos",
         ),
         "_protoc": attr.label(
             executable = True,
@@ -248,11 +248,11 @@
             default = [
                 # TODO: Add dependencies for cc runtime (absl/string etc..)
                 "//upb:generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
-                "//upb/protos:generated_protos_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
+                "//protos:generated_protos_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
                 "@com_google_absl//absl/strings",
                 "@com_google_absl//absl/status:statusor",
-                "//upb/protos",
-                "//upb/protos:repeated_field",
+                "//protos",
+                "//protos:repeated_field",
             ],
         ),
     },
@@ -283,7 +283,7 @@
             providers = [ProtoInfo],
         ),
         "_ccopts": attr.label(
-            default = "//upb/protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use",
+            default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use",
         ),
     },
 )
diff --git a/upb/protos/protos.cc b/protos/protos.cc
similarity index 93%
rename from upb/protos/protos.cc
rename to protos/protos.cc
index 85929ea..29b9fbe 100644
--- a/upb/protos/protos.cc
+++ b/protos/protos.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos/protos.h"
+#include "protos/protos.h"
 
 #include <atomic>
 #include <cstddef>
@@ -37,17 +37,17 @@
 #include "absl/status/statusor.h"
 #include "absl/strings/str_format.h"
 #include "absl/strings/string_view.h"
-#include "upb/protos/protos_extension_lock.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/copy.h"
-#include "upb/upb/message/internal/extension.h"
-#include "upb/upb/message/promote.h"
-#include "upb/upb/message/types.h"
-#include "upb/upb/mini_table/extension.h"
-#include "upb/upb/mini_table/extension_registry.h"
-#include "upb/upb/mini_table/message.h"
-#include "upb/upb/wire/decode.h"
-#include "upb/upb/wire/encode.h"
+#include "protos/protos_extension_lock.h"
+#include "upb/mem/arena.h"
+#include "upb/message/copy.h"
+#include "upb/message/internal/extension.h"
+#include "upb/message/promote.h"
+#include "upb/message/types.h"
+#include "upb/mini_table/extension.h"
+#include "upb/mini_table/extension_registry.h"
+#include "upb/mini_table/message.h"
+#include "upb/wire/decode.h"
+#include "upb/wire/encode.h"
 
 namespace protos {
 
diff --git a/upb/protos/protos.h b/protos/protos.h
similarity index 98%
rename from upb/protos/protos.h
rename to protos/protos.h
index 151c3d7..195d793 100644
--- a/upb/protos/protos.h
+++ b/protos/protos.h
@@ -36,13 +36,13 @@
 
 #include "absl/status/status.h"
 #include "absl/status/statusor.h"
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/message/copy.h"
-#include "upb/upb/message/internal/accessors.h"
-#include "upb/upb/message/internal/extension.h"
-#include "upb/upb/wire/decode.h"
-#include "upb/upb/wire/encode.h"
+#include "upb/base/status.hpp"
+#include "upb/mem/arena.hpp"
+#include "upb/message/copy.h"
+#include "upb/message/internal/accessors.h"
+#include "upb/message/internal/extension.h"
+#include "upb/wire/decode.h"
+#include "upb/wire/encode.h"
 
 namespace protos {
 
diff --git a/upb/protos/protos_extension_lock.cc b/protos/protos_extension_lock.cc
similarity index 97%
rename from upb/protos/protos_extension_lock.cc
rename to protos/protos_extension_lock.cc
index bb0dc97..dbb2fc2 100644
--- a/upb/protos/protos_extension_lock.cc
+++ b/protos/protos_extension_lock.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos/protos_extension_lock.h"
+#include "protos/protos_extension_lock.h"
 
 #include <atomic>
 
diff --git a/upb/protos/protos_extension_lock.h b/protos/protos_extension_lock.h
similarity index 100%
rename from upb/protos/protos_extension_lock.h
rename to protos/protos_extension_lock.h
diff --git a/upb/protos/protos_extension_lock_test.cc b/protos/protos_extension_lock_test.cc
similarity index 96%
rename from upb/protos/protos_extension_lock_test.cc
rename to protos/protos_extension_lock_test.cc
index 0d591b7..a0ce399 100644
--- a/upb/protos/protos_extension_lock_test.cc
+++ b/protos/protos_extension_lock_test.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos/protos_extension_lock.h"
+#include "protos/protos_extension_lock.h"
 
 #include <atomic>
 #include <mutex>
@@ -39,9 +39,9 @@
 #include <gtest/gtest.h>
 #include "absl/hash/hash.h"
 #include "absl/log/absl_check.h"
-#include "upb/protos/protos.h"
-#include "upb/protos_generator/tests/test_model.upb.proto.h"
-#include "upb/upb/mem/arena.hpp"
+#include "protos/protos.h"
+#include "protos_generator/tests/test_model.upb.proto.h"
+#include "upb/mem/arena.hpp"
 
 #ifndef ASSERT_OK
 #define ASSERT_OK(x) ASSERT_TRUE(x.ok())
diff --git a/upb/protos/protos_internal.h b/protos/protos_internal.h
similarity index 96%
rename from upb/protos/protos_internal.h
rename to protos/protos_internal.h
index c707ae5..0a1f194 100644
--- a/upb/protos/protos_internal.h
+++ b/protos/protos_internal.h
@@ -31,8 +31,8 @@
 #ifndef UPB_PROTOS_PROTOS_INTERNAL_H_
 #define UPB_PROTOS_PROTOS_INTERNAL_H_
 
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/message.h"
+#include "upb/mem/arena.h"
+#include "upb/message/message.h"
 
 namespace protos::internal {
 
diff --git a/upb/protos/protos_internal_test.cc b/protos/protos_internal_test.cc
similarity index 92%
rename from upb/protos/protos_internal_test.cc
rename to protos/protos_internal_test.cc
index ac65963..a173665 100644
--- a/upb/protos/protos_internal_test.cc
+++ b/protos/protos_internal_test.cc
@@ -28,13 +28,13 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos/protos_internal.h"
+#include "protos/protos_internal.h"
 
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
-#include "upb/protos_generator/tests/test_model.upb.h"
-#include "upb/protos_generator/tests/test_model.upb.proto.h"
-#include "upb/upb/mem/arena.h"
+#include "protos_generator/tests/test_model.upb.h"
+#include "protos_generator/tests/test_model.upb.proto.h"
+#include "upb/mem/arena.h"
 
 namespace protos::testing {
 namespace {
diff --git a/upb/protos/protos_traits.h b/protos/protos_traits.h
similarity index 100%
rename from upb/protos/protos_traits.h
rename to protos/protos_traits.h
diff --git a/upb/protos/repeated_field.h b/protos/repeated_field.h
similarity index 96%
rename from upb/protos/repeated_field.h
rename to protos/repeated_field.h
index f568f76..6edcfb5 100644
--- a/upb/protos/repeated_field.h
+++ b/protos/repeated_field.h
@@ -36,17 +36,17 @@
 #include <type_traits>
 
 #include "absl/strings/string_view.h"
-#include "upb/protos/protos.h"
-#include "upb/protos/protos_traits.h"
-#include "upb/protos/repeated_field_iterator.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/collections/array.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/copy.h"
-#include "upb/upb/message/types.h"
+#include "protos/protos.h"
+#include "protos/protos_traits.h"
+#include "protos/repeated_field_iterator.h"
+#include "upb/base/string_view.h"
+#include "upb/collections/array.h"
+#include "upb/mem/arena.h"
+#include "upb/message/copy.h"
+#include "upb/message/types.h"
 
 // Must be last:
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace protos {
 
@@ -320,6 +320,6 @@
 
 }  // namespace protos
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_PROTOS_REPEATED_FIELD_H_
diff --git a/upb/protos/repeated_field_iterator.h b/protos/repeated_field_iterator.h
similarity index 97%
rename from upb/protos/repeated_field_iterator.h
rename to protos/repeated_field_iterator.h
index 7593cde..a552d76 100644
--- a/upb/protos/repeated_field_iterator.h
+++ b/protos/repeated_field_iterator.h
@@ -36,15 +36,15 @@
 #include <type_traits>
 
 #include "absl/strings/string_view.h"
-#include "upb/protos/protos.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/collections/array.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/copy.h"
+#include "protos/protos.h"
+#include "upb/base/string_view.h"
+#include "upb/collections/array.h"
+#include "upb/mem/arena.h"
+#include "upb/message/copy.h"
 
 // Must be last:
-#include "upb/upb/message/types.h"
-#include "upb/upb/port/def.inc"
+#include "upb/message/types.h"
+#include "upb/port/def.inc"
 
 namespace protos {
 namespace internal {
diff --git a/upb/protos/repeated_field_iterator_test.cc b/protos/repeated_field_iterator_test.cc
similarity index 99%
rename from upb/protos/repeated_field_iterator_test.cc
rename to protos/repeated_field_iterator_test.cc
index a8db041..a8de900 100644
--- a/upb/protos/repeated_field_iterator_test.cc
+++ b/protos/repeated_field_iterator_test.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos/repeated_field_iterator.h"
+#include "protos/repeated_field_iterator.h"
 
 #include <algorithm>
 #include <array>
diff --git a/upb/protos_generator/BUILD b/protos_generator/BUILD
similarity index 90%
rename from upb/protos_generator/BUILD
rename to protos_generator/BUILD
index 3473450..fae587a 100644
--- a/upb/protos_generator/BUILD
+++ b/protos_generator/BUILD
@@ -6,7 +6,7 @@
 # https://developers.google.com/open-source/licenses/bsd
 
 load(
-    "//upb/bazel:build_defs.bzl",
+    "//bazel:build_defs.bzl",
     "UPB_DEFAULT_CPPOPTS",
 )
 
@@ -30,7 +30,7 @@
         ":output",
         "//:protobuf",
         "//src/google/protobuf/compiler:code_generator",
-        "//upb/upbc:file_layout",
+        "//upbc:file_layout",
     ],
 )
 
@@ -56,12 +56,12 @@
         ":names",
         ":output",
         "//:protobuf",
-        "//upb/upbc:common",
-        "//upb/upbc:file_layout",
-        "//upb/upbc:keywords",
-        "//upb/upbc:names",
         "@com_google_absl//absl/container:flat_hash_set",
         "@com_google_absl//absl/strings",
+        "//upbc:common",
+        "//upbc:file_layout",
+        "//upbc:keywords",
+        "//upbc:names",
     ],
 )
 
@@ -96,6 +96,6 @@
     visibility = ["//visibility:private"],
     deps = [
         ":output",
-        "//upb/upbc:keywords",
+        "//upbc:keywords",
     ],
 )
diff --git a/protos_generator/README.md b/protos_generator/README.md
new file mode 100644
index 0000000..05b64c0
--- /dev/null
+++ b/protos_generator/README.md
@@ -0,0 +1,8 @@
+`protos` Generator
+==================
+
+This directory contains the generator for the [`protos`
+API](https://github.com/protocolbuffers/protobuf/tree/main/protos), an
+experimental C++ protobuf implementation. Most users should use the standard
+C++ implementation
+[here](https://github.com/protocolbuffers/protobuf/tree/main/src).
diff --git a/upb/protos_generator/gen_accessors.cc b/protos_generator/gen_accessors.cc
similarity index 98%
rename from upb/protos_generator/gen_accessors.cc
rename to protos_generator/gen_accessors.cc
index 1d23979..410a42b 100644
--- a/upb/protos_generator/gen_accessors.cc
+++ b/protos_generator/gen_accessors.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos_generator/gen_accessors.h"
+#include "protos_generator/gen_accessors.h"
 
 #include <string>
 
@@ -37,13 +37,13 @@
 #include "absl/strings/str_cat.h"
 #include "absl/strings/string_view.h"
 #include "google/protobuf/descriptor.h"
-#include "upb/protos_generator/gen_repeated_fields.h"
-#include "upb/protos_generator/gen_utils.h"
-#include "upb/protos_generator/names.h"
-#include "upb/protos_generator/output.h"
-#include "upb/upbc/common.h"
-#include "upb/upbc/keywords.h"
-#include "upb/upbc/names.h"
+#include "protos_generator/gen_repeated_fields.h"
+#include "protos_generator/gen_utils.h"
+#include "protos_generator/names.h"
+#include "protos_generator/output.h"
+#include "upbc/common.h"
+#include "upbc/keywords.h"
+#include "upbc/names.h"
 
 namespace protos_generator {
 
diff --git a/upb/protos_generator/gen_accessors.h b/protos_generator/gen_accessors.h
similarity index 96%
rename from upb/protos_generator/gen_accessors.h
rename to protos_generator/gen_accessors.h
index 23e098f..8372fc3 100644
--- a/upb/protos_generator/gen_accessors.h
+++ b/protos_generator/gen_accessors.h
@@ -32,8 +32,8 @@
 #define UPB_PROTOS_GENERATOR_ACCESSORS_H_
 
 #include "google/protobuf/descriptor.h"
-#include "upb/protos_generator/gen_utils.h"
-#include "upb/protos_generator/output.h"
+#include "protos_generator/gen_utils.h"
+#include "protos_generator/output.h"
 
 namespace protos_generator {
 
diff --git a/upb/protos_generator/gen_enums.cc b/protos_generator/gen_enums.cc
similarity index 97%
rename from upb/protos_generator/gen_enums.cc
rename to protos_generator/gen_enums.cc
index ceea05c..7c535a7 100644
--- a/upb/protos_generator/gen_enums.cc
+++ b/protos_generator/gen_enums.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos_generator/gen_enums.h"
+#include "protos_generator/gen_enums.h"
 
 #include <algorithm>
 #include <limits>
@@ -37,8 +37,8 @@
 
 #include "google/protobuf/descriptor.pb.h"
 #include "google/protobuf/descriptor.h"
-#include "upb/protos_generator/gen_utils.h"
-#include "upb/protos_generator/names.h"
+#include "protos_generator/gen_utils.h"
+#include "protos_generator/names.h"
 
 namespace protos_generator {
 
diff --git a/upb/protos_generator/gen_enums.h b/protos_generator/gen_enums.h
similarity index 97%
rename from upb/protos_generator/gen_enums.h
rename to protos_generator/gen_enums.h
index fa7cccd..6078762 100644
--- a/upb/protos_generator/gen_enums.h
+++ b/protos_generator/gen_enums.h
@@ -32,7 +32,7 @@
 #define UPB_PROTOS_GENERATOR_ENUMS_H_
 
 #include "google/protobuf/descriptor.h"
-#include "upb/protos_generator/output.h"
+#include "protos_generator/output.h"
 
 namespace protos_generator {
 
diff --git a/upb/protos_generator/gen_extensions.cc b/protos_generator/gen_extensions.cc
similarity index 96%
rename from upb/protos_generator/gen_extensions.cc
rename to protos_generator/gen_extensions.cc
index ae4030c..be0cbc5 100644
--- a/upb/protos_generator/gen_extensions.cc
+++ b/protos_generator/gen_extensions.cc
@@ -28,11 +28,11 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos_generator/gen_extensions.h"
+#include "protos_generator/gen_extensions.h"
 
 #include "absl/strings/str_cat.h"
-#include "upb/protos_generator/gen_utils.h"
-#include "upb/protos_generator/names.h"
+#include "protos_generator/gen_utils.h"
+#include "protos_generator/names.h"
 
 namespace protos_generator {
 
diff --git a/upb/protos_generator/gen_extensions.h b/protos_generator/gen_extensions.h
similarity index 98%
rename from upb/protos_generator/gen_extensions.h
rename to protos_generator/gen_extensions.h
index 85d1a9a..8ec740a 100644
--- a/upb/protos_generator/gen_extensions.h
+++ b/protos_generator/gen_extensions.h
@@ -32,7 +32,7 @@
 #define UPB_PROTOS_GENERATOR_GEN_EXTENSIONS_H_
 
 #include "google/protobuf/descriptor.h"
-#include "upb/protos_generator/output.h"
+#include "protos_generator/output.h"
 
 namespace protos_generator {
 
diff --git a/upb/protos_generator/gen_messages.cc b/protos_generator/gen_messages.cc
similarity index 97%
rename from upb/protos_generator/gen_messages.cc
rename to protos_generator/gen_messages.cc
index 716562c..ca75ba7 100644
--- a/upb/protos_generator/gen_messages.cc
+++ b/protos_generator/gen_messages.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos_generator/gen_messages.h"
+#include "protos_generator/gen_messages.h"
 
 #include <string>
 #include <vector>
@@ -36,14 +36,14 @@
 #include "google/protobuf/descriptor.pb.h"
 #include "absl/strings/str_cat.h"
 #include "google/protobuf/descriptor.h"
-#include "upb/protos_generator/gen_accessors.h"
-#include "upb/protos_generator/gen_enums.h"
-#include "upb/protos_generator/gen_extensions.h"
-#include "upb/protos_generator/gen_utils.h"
-#include "upb/protos_generator/names.h"
-#include "upb/protos_generator/output.h"
-#include "upb/upbc/common.h"
-#include "upb/upbc/file_layout.h"
+#include "protos_generator/gen_accessors.h"
+#include "protos_generator/gen_enums.h"
+#include "protos_generator/gen_extensions.h"
+#include "protos_generator/gen_utils.h"
+#include "protos_generator/names.h"
+#include "protos_generator/output.h"
+#include "upbc/common.h"
+#include "upbc/file_layout.h"
 
 namespace protos_generator {
 
diff --git a/upb/protos_generator/gen_messages.h b/protos_generator/gen_messages.h
similarity index 97%
rename from upb/protos_generator/gen_messages.h
rename to protos_generator/gen_messages.h
index 97813cf..3236964 100644
--- a/upb/protos_generator/gen_messages.h
+++ b/protos_generator/gen_messages.h
@@ -32,7 +32,7 @@
 #define UPB_PROTOS_GENERATOR_GEN_MESSAGES_H_
 
 #include "google/protobuf/descriptor.h"
-#include "upb/protos_generator/output.h"
+#include "protos_generator/output.h"
 
 namespace protos_generator {
 namespace protobuf = ::google::protobuf;
diff --git a/upb/protos_generator/gen_repeated_fields.cc b/protos_generator/gen_repeated_fields.cc
similarity index 96%
rename from upb/protos_generator/gen_repeated_fields.cc
rename to protos_generator/gen_repeated_fields.cc
index 3c962ac..d5b4bab 100644
--- a/upb/protos_generator/gen_repeated_fields.cc
+++ b/protos_generator/gen_repeated_fields.cc
@@ -27,7 +27,7 @@
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "upb/protos_generator/gen_repeated_fields.h"
+#include "protos_generator/gen_repeated_fields.h"
 
 #include <string>
 #include <vector>
@@ -35,15 +35,15 @@
 #include "google/protobuf/descriptor.pb.h"
 #include "absl/strings/string_view.h"
 #include "google/protobuf/descriptor.h"
-#include "upb/protos_generator/gen_accessors.h"
-#include "upb/protos_generator/gen_enums.h"
-#include "upb/protos_generator/gen_extensions.h"
-#include "upb/protos_generator/gen_utils.h"
-#include "upb/protos_generator/names.h"
-#include "upb/protos_generator/output.h"
-#include "upb/upbc/common.h"
-#include "upb/upbc/file_layout.h"
-#include "upb/upbc/names.h"
+#include "protos_generator/gen_accessors.h"
+#include "protos_generator/gen_enums.h"
+#include "protos_generator/gen_extensions.h"
+#include "protos_generator/gen_utils.h"
+#include "protos_generator/names.h"
+#include "protos_generator/output.h"
+#include "upbc/common.h"
+#include "upbc/file_layout.h"
+#include "upbc/names.h"
 
 namespace protos_generator {
 namespace protobuf = ::google::protobuf;
diff --git a/upb/protos_generator/gen_repeated_fields.h b/protos_generator/gen_repeated_fields.h
similarity index 98%
rename from upb/protos_generator/gen_repeated_fields.h
rename to protos_generator/gen_repeated_fields.h
index 5902a5d..1650eb0 100644
--- a/upb/protos_generator/gen_repeated_fields.h
+++ b/protos_generator/gen_repeated_fields.h
@@ -33,7 +33,7 @@
 
 #include "absl/strings/string_view.h"
 #include "google/protobuf/descriptor.h"
-#include "upb/protos_generator/output.h"
+#include "protos_generator/output.h"
 
 namespace protos_generator {
 namespace protobuf = ::google::protobuf;
diff --git a/upb/protos_generator/gen_utils.cc b/protos_generator/gen_utils.cc
similarity index 98%
rename from upb/protos_generator/gen_utils.cc
rename to protos_generator/gen_utils.cc
index 7c59d7f..79dd5a1 100644
--- a/upb/protos_generator/gen_utils.cc
+++ b/protos_generator/gen_utils.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos_generator/gen_utils.h"
+#include "protos_generator/gen_utils.h"
 
 #include <algorithm>
 #include <string>
diff --git a/upb/protos_generator/gen_utils.h b/protos_generator/gen_utils.h
similarity index 100%
rename from upb/protos_generator/gen_utils.h
rename to protos_generator/gen_utils.h
diff --git a/upb/protos_generator/names.cc b/protos_generator/names.cc
similarity index 98%
rename from upb/protos_generator/names.cc
rename to protos_generator/names.cc
index c1c3d8e..eb3fbee 100644
--- a/upb/protos_generator/names.cc
+++ b/protos_generator/names.cc
@@ -28,11 +28,11 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos_generator/names.h"
+#include "protos_generator/names.h"
 
 #include <string>
 
-#include "upb/upbc/keywords.h"
+#include "upbc/keywords.h"
 
 namespace protos_generator {
 
diff --git a/upb/protos_generator/names.h b/protos_generator/names.h
similarity index 98%
rename from upb/protos_generator/names.h
rename to protos_generator/names.h
index 4578703..efa01ce 100644
--- a/upb/protos_generator/names.h
+++ b/protos_generator/names.h
@@ -34,7 +34,7 @@
 #include <string>
 
 #include "google/protobuf/descriptor.pb.h"
-#include "upb/protos_generator/output.h"
+#include "protos_generator/output.h"
 
 namespace protos_generator {
 
diff --git a/upb/protos_generator/output.cc b/protos_generator/output.cc
similarity index 98%
rename from upb/protos_generator/output.cc
rename to protos_generator/output.cc
index 67a33b3..72cd4e5 100644
--- a/upb/protos_generator/output.cc
+++ b/protos_generator/output.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/protos_generator/output.h"
+#include "protos_generator/output.h"
 
 #include <string>
 
diff --git a/upb/protos_generator/output.h b/protos_generator/output.h
similarity index 100%
rename from upb/protos_generator/output.h
rename to protos_generator/output.h
diff --git a/upb/protos_generator/protoc-gen-upb-protos.cc b/protos_generator/protoc-gen-upb-protos.cc
similarity index 93%
rename from upb/protos_generator/protoc-gen-upb-protos.cc
rename to protos_generator/protoc-gen-upb-protos.cc
index 7907ed5..58c3712 100644
--- a/upb/protos_generator/protoc-gen-upb-protos.cc
+++ b/protos_generator/protoc-gen-upb-protos.cc
@@ -34,13 +34,13 @@
 #include "google/protobuf/compiler/code_generator.h"
 #include "google/protobuf/compiler/plugin.h"
 #include "google/protobuf/descriptor.h"
-#include "upb/protos_generator/gen_enums.h"
-#include "upb/protos_generator/gen_extensions.h"
-#include "upb/protos_generator/gen_messages.h"
-#include "upb/protos_generator/gen_utils.h"
-#include "upb/protos_generator/names.h"
-#include "upb/protos_generator/output.h"
-#include "upb/upbc/file_layout.h"
+#include "protos_generator/gen_enums.h"
+#include "protos_generator/gen_extensions.h"
+#include "protos_generator/gen_messages.h"
+#include "protos_generator/gen_utils.h"
+#include "protos_generator/names.h"
+#include "protos_generator/output.h"
+#include "upbc/file_layout.h"
 
 namespace protos_generator {
 namespace {
@@ -138,9 +138,9 @@
 #ifndef $0_UPB_PROTO_H_
 #define $0_UPB_PROTO_H_
 
-#include "upb/protos/protos.h"
-#include "upb/protos/protos_internal.h"
-#include "upb/protos/repeated_field.h"
+#include "protos/protos.h"
+#include "protos/protos_internal.h"
+#include "protos/repeated_field.h"
 
 #include "absl/strings/string_view.h"
 #include "absl/status/statusor.h"
@@ -158,7 +158,7 @@
     }
   }
 
-  output("#include \"upb/upb/port/def.inc\"\n");
+  output("#include \"upb/port/def.inc\"\n");
 
   const std::vector<const protobuf::Descriptor*> this_file_messages =
       SortedMessages(file);
@@ -190,7 +190,7 @@
 
   WriteEndNamespace(file, output);
 
-  output("\n#include \"upb/upb/port/undef.inc\"\n\n");
+  output("\n#include \"upb/port/undef.inc\"\n\n");
   // End of "C" section.
 
   output("#endif  /* $0_UPB_PROTO_H_ */\n", ToPreproc(file->name()));
@@ -205,7 +205,7 @@
       R"cc(
 #include <stddef.h>
 #include "absl/strings/string_view.h"
-#include "upb/protos/protos.h"
+#include "protos/protos.h"
 #include "$0"
       )cc",
       CppHeaderFilename(file));
@@ -213,7 +213,7 @@
   for (int i = 0; i < file->dependency_count(); i++) {
     output("#include \"$0\"\n", CppHeaderFilename(file->dependency(i)));
   }
-  output("#include \"upb/upb/port/def.inc\"\n");
+  output("#include \"upb/port/def.inc\"\n");
 
   WriteStartNamespace(file, output);
   WriteMessageImplementations(file, output);
@@ -222,7 +222,7 @@
   WriteExtensionIdentifiers(this_file_exts, output);
   WriteEndNamespace(file, output);
 
-  output("#include \"upb/upb/port/undef.inc\"\n\n");
+  output("#include \"upb/port/undef.inc\"\n\n");
 }
 
 void WriteMessageImplementations(const protobuf::FileDescriptor* file,
diff --git a/upb/protos_generator/tests/BUILD b/protos_generator/tests/BUILD
similarity index 91%
rename from upb/protos_generator/tests/BUILD
rename to protos_generator/tests/BUILD
index dfc80b4..e5c203f 100644
--- a/upb/protos_generator/tests/BUILD
+++ b/protos_generator/tests/BUILD
@@ -6,15 +6,15 @@
 # https://developers.google.com/open-source/licenses/bsd
 
 load(
-    "//upb/bazel:build_defs.bzl",
+    "//bazel:build_defs.bzl",
     "UPB_DEFAULT_CPPOPTS",
 )
 load(
-    "//upb/bazel:upb_proto_library.bzl",
+    "//bazel:upb_proto_library.bzl",
     "upb_proto_library",
 )
 load(
-    "//upb/protos/bazel:upb_cc_proto_library.bzl",
+    "//protos/bazel:upb_cc_proto_library.bzl",
     "upb_cc_proto_library",
 )
 load(
@@ -63,14 +63,14 @@
 upb_proto_library(
     name = "test_model_upb_proto",
     visibility = [
-        "//upb/protos:__pkg__",
+        "//protos:__pkg__",
     ],
     deps = [":test_model_proto"],
 )
 
 upb_cc_proto_library(
     name = "test_model_upb_cc_proto",
-    visibility = ["//upb/protos:__pkg__"],
+    visibility = ["//protos:__pkg__"],
     deps = [":test_model_proto"],
 )
 
@@ -133,8 +133,8 @@
         "@com_google_googletest//:gtest_main",
         "@com_google_absl//absl/status:statusor",
         "@com_google_absl//absl/strings",
-        "//upb/protos",
+        "//protos",
         "//upb:mem",
-        "//upb/protos:repeated_field",
+        "//protos:repeated_field",
     ],
 )
diff --git a/upb/protos_generator/tests/child_model.proto b/protos_generator/tests/child_model.proto
similarity index 96%
rename from upb/protos_generator/tests/child_model.proto
rename to protos_generator/tests/child_model.proto
index 79589cc..c7af6f1 100644
--- a/upb/protos_generator/tests/child_model.proto
+++ b/protos_generator/tests/child_model.proto
@@ -32,7 +32,7 @@
 
 package protos_generator.test;
 
-import public "upb/protos_generator/tests/test_enum.proto";
+import public "protos_generator/tests/test_enum.proto";
 
 message ChildModel1 {
   optional bool child_b1 = 44;
diff --git a/upb/protos_generator/tests/legacy-name.proto b/protos_generator/tests/legacy-name.proto
similarity index 100%
rename from upb/protos_generator/tests/legacy-name.proto
rename to protos_generator/tests/legacy-name.proto
diff --git a/upb/protos_generator/tests/naming_conflict.proto b/protos_generator/tests/naming_conflict.proto
similarity index 100%
rename from upb/protos_generator/tests/naming_conflict.proto
rename to protos_generator/tests/naming_conflict.proto
diff --git a/upb/protos_generator/tests/no_package.proto b/protos_generator/tests/no_package.proto
similarity index 100%
rename from upb/protos_generator/tests/no_package.proto
rename to protos_generator/tests/no_package.proto
diff --git a/upb/protos_generator/tests/no_package_enum_user.proto b/protos_generator/tests/no_package_enum_user.proto
similarity index 96%
rename from upb/protos_generator/tests/no_package_enum_user.proto
rename to protos_generator/tests/no_package_enum_user.proto
index e34c7fe..ebf8c67 100644
--- a/upb/protos_generator/tests/no_package_enum_user.proto
+++ b/protos_generator/tests/no_package_enum_user.proto
@@ -32,7 +32,7 @@
 
 package protos_generator.tests;
 
-import "upb/protos_generator/tests/no_package.proto";
+import "protos_generator/tests/no_package.proto";
 
 // option java_multiple_files = true;
 
diff --git a/upb/protos_generator/tests/test_enum.proto b/protos_generator/tests/test_enum.proto
similarity index 100%
rename from upb/protos_generator/tests/test_enum.proto
rename to protos_generator/tests/test_enum.proto
diff --git a/upb/protos_generator/tests/test_extension.proto b/protos_generator/tests/test_extension.proto
similarity index 96%
rename from upb/protos_generator/tests/test_extension.proto
rename to protos_generator/tests/test_extension.proto
index 17f7131..3a1a3c6 100644
--- a/upb/protos_generator/tests/test_extension.proto
+++ b/protos_generator/tests/test_extension.proto
@@ -32,7 +32,7 @@
 
 package protos_generator.test.someotherpackage;
 
-import "upb/protos_generator/tests/test_model.proto";
+import "protos_generator/tests/test_model.proto";
 
 // Define extension that is extending proto outside this package with a type
 // defined in different file.
diff --git a/upb/protos_generator/tests/test_generated.cc b/protos_generator/tests/test_generated.cc
similarity index 98%
rename from upb/protos_generator/tests/test_generated.cc
rename to protos_generator/tests/test_generated.cc
index 4d0cf80..1206b6a 100644
--- a/upb/protos_generator/tests/test_generated.cc
+++ b/protos_generator/tests/test_generated.cc
@@ -38,13 +38,13 @@
 #include <gtest/gtest.h>
 #include "absl/status/statusor.h"
 #include "absl/strings/string_view.h"
-#include "upb/protos/protos.h"
-#include "upb/protos/repeated_field.h"
-#include "upb/protos/repeated_field_iterator.h"
-#include "upb/protos_generator/tests/child_model.upb.proto.h"
-#include "upb/protos_generator/tests/no_package.upb.proto.h"
-#include "upb/protos_generator/tests/test_model.upb.proto.h"
-#include "upb/upb/mem/arena.h"
+#include "protos/protos.h"
+#include "protos/repeated_field.h"
+#include "protos/repeated_field_iterator.h"
+#include "protos_generator/tests/child_model.upb.proto.h"
+#include "protos_generator/tests/no_package.upb.proto.h"
+#include "protos_generator/tests/test_model.upb.proto.h"
+#include "upb/mem/arena.h"
 
 namespace {
 
diff --git a/upb/protos_generator/tests/test_model.proto b/protos_generator/tests/test_model.proto
similarity index 98%
rename from upb/protos_generator/tests/test_model.proto
rename to protos_generator/tests/test_model.proto
index 89372f5..e133624 100644
--- a/upb/protos_generator/tests/test_model.proto
+++ b/protos_generator/tests/test_model.proto
@@ -32,7 +32,7 @@
 
 package protos_generator.test;
 
-import "upb/protos_generator/tests/child_model.proto";
+import "protos_generator/tests/child_model.proto";
 
 message TestModelContainer {
   repeated TestModel models = 1;
diff --git a/upb/python/BUILD b/python/BUILD
similarity index 93%
rename from upb/python/BUILD
rename to python/BUILD
index 8987b0d..c1e044c 100644
--- a/upb/python/BUILD
+++ b/python/BUILD
@@ -5,13 +5,15 @@
 # license that can be found in the LICENSE file or at
 # https://developers.google.com/open-source/licenses/bsd
 
-load("//upb/python:py_extension.bzl", "py_extension")
+load("//python:py_extension.bzl", "py_extension")
 load("@bazel_skylib//lib:selects.bzl", "selects")
 load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 
 # begin:github_only
 load("@rules_pkg//:mappings.bzl", "pkg_files")
+load("//python:build_targets.bzl", "build_targets")
+build_targets(name = "python")
 # end:github_only
 
 licenses(["notice"])
@@ -20,7 +22,7 @@
     # begin:google_only
 #     default_applicable_licenses = ["//upb:license"],
     # end:google_only
-    default_visibility = ["//upb/python/dist:__pkg__"],
+    default_visibility = ["//python/dist:__pkg__"],
 )
 
 LIMITED_API_FLAG_SELECT = {
@@ -224,8 +226,8 @@
         "//upb:text",
         "//upb:wire_reader",
         "//upb:wire_types",
-        "//upb/upb/util:compare",
-        "//upb/upb/util:def_to_proto",
-        "//upb/upb/util:required_fields",
+        "//upb/util:compare",
+        "//upb/util:def_to_proto",
+        "//upb/util:required_fields",
     ],
 )
diff --git a/python/BUILD.bazel b/python/BUILD.bazel
deleted file mode 100644
index b42d0b2..0000000
--- a/python/BUILD.bazel
+++ /dev/null
@@ -1,6 +0,0 @@
-load("//python:build_targets.bzl", "build_targets")
-
-# The build targets for this package have been temporarily moved into a Bazel
-# macro to facilitate merging upb's Python support into this directory. Once
-# that merge is complete, we will move the build targets back here.
-build_targets(name = "python")
diff --git a/python/README.md b/python/README.md
index baa58c2..ab39350 100644
--- a/python/README.md
+++ b/python/README.md
@@ -21,8 +21,8 @@
 can use the following Bazel commands:
 
 ```
-$ bazel build //upb/python/dist:source_wheel
-$ bazel build //upb/python/dist:binary_wheel
+$ bazel build //python/dist:source_wheel
+$ bazel build //python/dist:binary_wheel
 ```
 
 The binary wheel will build against whatever version of Python is installed on
@@ -43,13 +43,12 @@
 following values:
 
 1.  **upb**: Built on the
-    [upb C library](https://github.com/protocolbuffers/upb), this is a new
-    extension module
+    [upb C library](https://github.com/protocolbuffers/protobuf/tree/main/upb),
+    this is a new extension module
     [released in 4.21.0](https://protobuf.dev/news/2022-05-06/). It offers
     better performance than any of the previous backends, and it is now the
     default. It is distributed in our PyPI packages, and requires no special
-    installation. The code for this module lives in
-    [upb/python](https://github.com/protocolbuffers/protobuf/tree/main/upb/python).
+    installation. The code for this module lives in this directory.
 1.  **cpp**: This extension module wraps the C++ protobuf library. It is
     deprecated and is no longer released in our PyPI packages, however it is
     still used in some legacy cases where apps want to perform zero-copy message
diff --git a/python/build_targets.bzl b/python/build_targets.bzl
index 546ef01..026292c 100644
--- a/python/build_targets.bzl
+++ b/python/build_targets.bzl
@@ -444,7 +444,7 @@
             "tox.ini",
         ],
         strip_prefix = "",
-        visibility = ["//upb:__subpackages__"],
+        visibility = ["//python/dist:__pkg__"],
     )
 
     pkg_files(
@@ -456,9 +456,10 @@
             "google/protobuf/pyext/*.cc",
             "google/protobuf/pyext/*.h",
         ]) + [
-            "BUILD.bazel",
+            "BUILD",
             "MANIFEST.in",
             "README.md",
+            "build_targets.bzl",
             "google/protobuf/proto_api.h",
             "google/protobuf/pyext/README",
             "google/protobuf/python_protobuf.h",
diff --git a/upb/python/convert.c b/python/convert.c
similarity index 97%
rename from upb/python/convert.c
rename to python/convert.c
index f26324c..98d9b75 100644
--- a/upb/python/convert.c
+++ b/python/convert.c
@@ -28,16 +28,16 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/python/convert.h"
+#include "python/convert.h"
 
-#include "upb/python/message.h"
-#include "upb/python/protobuf.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/reflection/message.h"
-#include "upb/upb/util/compare.h"
+#include "python/message.h"
+#include "python/protobuf.h"
+#include "upb/collections/map.h"
+#include "upb/reflection/message.h"
+#include "upb/util/compare.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 PyObject* PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef* f,
                         PyObject* arena) {
@@ -443,4 +443,4 @@
          kUpb_UnknownCompareResult_Equal;
 }
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
diff --git a/upb/python/convert.h b/python/convert.h
similarity index 97%
rename from upb/python/convert.h
rename to python/convert.h
index 8233f7e..1c594d3 100644
--- a/upb/python/convert.h
+++ b/python/convert.h
@@ -32,8 +32,8 @@
 #define PYUPB_CONVERT_H__
 
 #include "protobuf.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/message.h"
+#include "upb/reflection/def.h"
+#include "upb/reflection/message.h"
 
 // Converts `val` to a Python object according to the type information in `f`.
 // Any newly-created Python objects that reference non-primitive data from `val`
diff --git a/upb/python/descriptor.c b/python/descriptor.c
similarity index 99%
rename from upb/python/descriptor.c
rename to python/descriptor.c
index f979108..d1726e4 100644
--- a/upb/python/descriptor.c
+++ b/python/descriptor.c
@@ -28,15 +28,15 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/python/descriptor.h"
+#include "python/descriptor.h"
 
-#include "upb/python/convert.h"
-#include "upb/python/descriptor_containers.h"
-#include "upb/python/descriptor_pool.h"
-#include "upb/python/message.h"
-#include "upb/python/protobuf.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/util/def_to_proto.h"
+#include "python/convert.h"
+#include "python/descriptor_containers.h"
+#include "python/descriptor_pool.h"
+#include "python/message.h"
+#include "python/protobuf.h"
+#include "upb/reflection/def.h"
+#include "upb/util/def_to_proto.h"
 
 // -----------------------------------------------------------------------------
 // DescriptorBase
diff --git a/upb/python/descriptor.h b/python/descriptor.h
similarity index 97%
rename from upb/python/descriptor.h
rename to python/descriptor.h
index 14cdfad..7fa0164 100644
--- a/upb/python/descriptor.h
+++ b/python/descriptor.h
@@ -33,8 +33,8 @@
 
 #include <stdbool.h>
 
-#include "upb/python/python_api.h"
-#include "upb/upb/reflection/def.h"
+#include "python/python_api.h"
+#include "upb/reflection/def.h"
 
 typedef enum {
   kPyUpb_Descriptor = 0,
diff --git a/upb/python/descriptor_containers.c b/python/descriptor_containers.c
similarity index 99%
rename from upb/python/descriptor_containers.c
rename to python/descriptor_containers.c
index 7aeafc5..e1eacb2 100644
--- a/upb/python/descriptor_containers.c
+++ b/python/descriptor_containers.c
@@ -28,11 +28,11 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/python/descriptor_containers.h"
+#include "python/descriptor_containers.h"
 
-#include "upb/python/descriptor.h"
-#include "upb/python/protobuf.h"
-#include "upb/upb/reflection/def.h"
+#include "python/descriptor.h"
+#include "python/protobuf.h"
+#include "upb/reflection/def.h"
 
 // Implements __repr__ as str(dict(self)).
 static PyObject* PyUpb_DescriptorMap_Repr(PyObject* _self) {
diff --git a/upb/python/descriptor_containers.h b/python/descriptor_containers.h
similarity index 99%
rename from upb/python/descriptor_containers.h
rename to python/descriptor_containers.h
index 004607b..5b2b1fa 100644
--- a/upb/python/descriptor_containers.h
+++ b/python/descriptor_containers.h
@@ -46,7 +46,7 @@
 #include <stdbool.h>
 
 #include "protobuf.h"
-#include "upb/upb/reflection/def.h"
+#include "upb/reflection/def.h"
 
 // -----------------------------------------------------------------------------
 // PyUpb_GenericSequence
diff --git a/upb/python/descriptor_pool.c b/python/descriptor_pool.c
similarity index 98%
rename from upb/python/descriptor_pool.c
rename to python/descriptor_pool.c
index db95259..ee41677 100644
--- a/upb/python/descriptor_pool.c
+++ b/python/descriptor_pool.c
@@ -28,15 +28,15 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/python/descriptor_pool.h"
+#include "python/descriptor_pool.h"
 
 #include "google/protobuf/descriptor.upbdefs.h"
-#include "upb/python/convert.h"
-#include "upb/python/descriptor.h"
-#include "upb/python/message.h"
-#include "upb/python/protobuf.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/util/def_to_proto.h"
+#include "python/convert.h"
+#include "python/descriptor.h"
+#include "python/message.h"
+#include "python/protobuf.h"
+#include "upb/reflection/def.h"
+#include "upb/util/def_to_proto.h"
 
 // -----------------------------------------------------------------------------
 // DescriptorPool
diff --git a/upb/python/descriptor_pool.h b/python/descriptor_pool.h
similarity index 100%
rename from upb/python/descriptor_pool.h
rename to python/descriptor_pool.h
diff --git a/upb/python/dist/BUILD.bazel b/python/dist/BUILD.bazel
similarity index 90%
rename from upb/python/dist/BUILD.bazel
rename to python/dist/BUILD.bazel
index c14757a..aa03fbe 100644
--- a/upb/python/dist/BUILD.bazel
+++ b/python/dist/BUILD.bazel
@@ -10,15 +10,15 @@
 load("@rules_python//python:packaging.bzl", "py_wheel")
 load("@system_python//:version.bzl", "SYSTEM_PYTHON_VERSION")
 load("//:protobuf_version.bzl", "PROTOBUF_PYTHON_VERSION")
+load("//bazel:py_proto_library.bzl", "py_proto_library")
 load("@bazel_skylib//lib:selects.bzl", "selects")
-load("//upb/bazel:py_proto_library.bzl", "py_proto_library")
 load(":dist.bzl", "py_dist", "py_dist_module")
 
 licenses(["notice"])
 
 py_dist_module(
     name = "message_mod",
-    extension = "//upb/python:_message_binary",
+    extension = "//python:_message_binary",
     module_name = "google._upb._message",
 )
 
@@ -235,20 +235,20 @@
     name = "filegroup_source_files",
     srcs = [
         "//:LICENSE",
+        "//python:message_srcs",
         "//upb:source_files",
-        "//upb/python:message_srcs",
-        "//upb/upb/base:source_files",
-        "//upb/upb/collections:source_files",
-        "//upb/upb/hash:source_files",
-        "//upb/upb/lex:source_files",
-        "//upb/upb/mem:source_files",
-        "//upb/upb/message:source_files",
-        "//upb/upb/mini_descriptor:source_files",
-        "//upb/upb/mini_table:source_files",
-        "//upb/upb/port:source_files",
-        "//upb/upb/text:source_files",
-        "//upb/upb/util:source_files",
-        "//upb/upb/wire:source_files",
+        "//upb/base:source_files",
+        "//upb/collections:source_files",
+        "//upb/hash:source_files",
+        "//upb/lex:source_files",
+        "//upb/mem:source_files",
+        "//upb/message:source_files",
+        "//upb/mini_descriptor:source_files",
+        "//upb/mini_table:source_files",
+        "//upb/port:source_files",
+        "//upb/text:source_files",
+        "//upb/util:source_files",
+        "//upb/wire:source_files",
     ],
     strip_prefix = strip_prefix.from_root(""),
 )
@@ -296,9 +296,9 @@
 py_wheel(
     name = "binary_wheel",
     abi = select({
-        "//upb/python:full_api_3.7": "cp37m",
-        "//upb/python:full_api_3.8": "cp38",
-        "//upb/python:full_api_3.9": "cp39",
+        "//python:full_api_3.7": "cp37m",
+        "//python:full_api_3.8": "cp38",
+        "//python:full_api_3.9": "cp39",
         "//conditions:default": "abi3",
     }),
     author = "protobuf@googlegroups.com",
@@ -330,14 +330,14 @@
     }),
     python_requires = ">=3.7",
     python_tag = selects.with_or({
-        ("//upb/python:limited_api_3.7", "//upb/python:full_api_3.7"): "cp37",
-        "//upb/python:full_api_3.8": "cp38",
-        "//upb/python:full_api_3.9": "cp39",
-        "//upb/python:limited_api_3.10": "cp310",
+        ("//python:limited_api_3.7", "//python:full_api_3.7"): "cp37",
+        "//python:full_api_3.8": "cp38",
+        "//python:full_api_3.9": "cp39",
+        "//python:limited_api_3.10": "cp310",
         "//conditions:default": "cp" + SYSTEM_PYTHON_VERSION,
     }),
     strip_path_prefixes = [
-        "upb/python/dist/",
+        "python/dist/",
         "python/",
         "src/",
     ],
@@ -415,8 +415,8 @@
         "//:python_common_test_protos",
         "//:python_specific_test_protos",
         "//:python_test_srcs",
+        "//python/pb_unit_tests:test_files",
         "//src/google/protobuf:testdata",
-        "//upb/python/pb_unit_tests:test_files",
     ],
 )
 
diff --git a/upb/python/dist/MANIFEST.in b/python/dist/MANIFEST.in
similarity index 100%
rename from upb/python/dist/MANIFEST.in
rename to python/dist/MANIFEST.in
diff --git a/upb/python/dist/dist.bzl b/python/dist/dist.bzl
similarity index 93%
rename from upb/python/dist/dist.bzl
rename to python/dist/dist.bzl
index 3545fa9..75c21c3 100644
--- a/upb/python/dist/dist.bzl
+++ b/python/dist/dist.bzl
@@ -121,8 +121,8 @@
             mandatory = True,
             cfg = _py_multiarch_transition,
         ),
-        "_limited_api": attr.label(default = "//upb/python:limited_api"),
-        "_python_version": attr.label(default = "//upb/python:python_version"),
+        "_limited_api": attr.label(default = "//python:limited_api"),
+        "_python_version": attr.label(default = "//python:python_version"),
         "_allowlist_function_transition": attr.label(
             default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
         ),
@@ -142,16 +142,16 @@
     for cpu, version in attr.limited_api_wheels.items():
         transitions.append({
             "//command_line_option:cpu": cpu,
-            "//upb/python:python_version": version,
-            "//upb/python:limited_api": True,
+            "//python:python_version": version,
+            "//python:limited_api": True,
         })
 
     for version in attr.full_api_versions:
         for cpu in attr.full_api_cpus:
             transitions.append({
                 "//command_line_option:cpu": cpu,
-                "//upb/python:python_version": version,
-                "//upb/python:limited_api": False,
+                "//python:python_version": version,
+                "//python:limited_api": False,
             })
 
     return transitions
@@ -161,8 +161,8 @@
     inputs = [],
     outputs = [
         "//command_line_option:cpu",
-        "//upb/python:python_version",
-        "//upb/python:limited_api",
+        "//python:python_version",
+        "//python:limited_api",
     ],
 )
 
diff --git a/upb/python/dist/setup.py b/python/dist/setup.py
similarity index 100%
rename from upb/python/dist/setup.py
rename to python/dist/setup.py
diff --git a/upb/python/extension_dict.c b/python/extension_dict.c
similarity index 98%
rename from upb/python/extension_dict.c
rename to python/extension_dict.c
index 914957a..d4b4dda 100644
--- a/upb/python/extension_dict.c
+++ b/python/extension_dict.c
@@ -28,11 +28,11 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/python/extension_dict.h"
+#include "python/extension_dict.h"
 
-#include "upb/python/message.h"
-#include "upb/python/protobuf.h"
-#include "upb/upb/reflection/def.h"
+#include "python/message.h"
+#include "python/protobuf.h"
+#include "upb/reflection/def.h"
 
 // -----------------------------------------------------------------------------
 // ExtensionDict
diff --git a/upb/python/extension_dict.h b/python/extension_dict.h
similarity index 97%
rename from upb/python/extension_dict.h
rename to python/extension_dict.h
index 724054f..99d2add 100644
--- a/upb/python/extension_dict.h
+++ b/python/extension_dict.h
@@ -33,7 +33,7 @@
 
 #include <stdbool.h>
 
-#include "upb/python/python_api.h"
+#include "python/python_api.h"
 
 PyObject* PyUpb_ExtensionDict_New(PyObject* msg);
 
diff --git a/python/google/protobuf/internal/numpy/BUILD.bazel b/python/google/protobuf/internal/numpy/BUILD.bazel
index 5c1c166..ffdc4e5 100644
--- a/python/google/protobuf/internal/numpy/BUILD.bazel
+++ b/python/google/protobuf/internal/numpy/BUILD.bazel
@@ -6,18 +6,18 @@
 
 # TODO: b/278896688 - Remove this target and replace with py_library
 exports_files([
-  "__init__.py",
-  "numpy_test.py",
+    "__init__.py",
+    "numpy_test.py",
 ])
 
 internal_py_test(
     name = "numpy_test",
     srcs = ["numpy_test.py"],
+    visibility = [
+        "//python:__pkg__",
+        "//python/pb_unit_tests:__pkg__",
+    ],
     deps = [
         requirement("numpy"),
     ],
-    visibility = [
-      "//python:__pkg__",
-      "//upb/python/pb_unit_tests:__pkg__",
-    ]
 )
diff --git a/upb/python/map.c b/python/map.c
similarity index 98%
rename from upb/python/map.c
rename to python/map.c
index ec0133c..bd9022d 100644
--- a/upb/python/map.c
+++ b/python/map.c
@@ -28,13 +28,13 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/python/map.h"
+#include "python/map.h"
 
-#include "upb/python/convert.h"
-#include "upb/python/message.h"
-#include "upb/python/protobuf.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/reflection/def.h"
+#include "python/convert.h"
+#include "python/message.h"
+#include "python/protobuf.h"
+#include "upb/collections/map.h"
+#include "upb/reflection/def.h"
 
 // -----------------------------------------------------------------------------
 // MapContainer
diff --git a/upb/python/map.h b/python/map.h
similarity index 97%
rename from upb/python/map.h
rename to python/map.h
index 6a24068..6c2c47d 100644
--- a/upb/python/map.h
+++ b/python/map.h
@@ -33,8 +33,8 @@
 
 #include <stdbool.h>
 
-#include "upb/python/python_api.h"
-#include "upb/upb/reflection/def.h"
+#include "python/python_api.h"
+#include "upb/reflection/def.h"
 
 // Creates a new repeated field stub for field `f` of message object `parent`.
 // Precondition: `parent` must be a stub.
diff --git a/upb/python/message.c b/python/message.c
similarity index 99%
rename from upb/python/message.c
rename to python/message.c
index f418938..0777e7e 100644
--- a/upb/python/message.c
+++ b/python/message.c
@@ -28,18 +28,18 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/python/message.h"
+#include "python/message.h"
 
-#include "upb/python/convert.h"
-#include "upb/python/descriptor.h"
-#include "upb/python/extension_dict.h"
-#include "upb/python/map.h"
-#include "upb/python/repeated.h"
-#include "upb/upb/message/copy.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/message.h"
-#include "upb/upb/text/encode.h"
-#include "upb/upb/util/required_fields.h"
+#include "python/convert.h"
+#include "python/descriptor.h"
+#include "python/extension_dict.h"
+#include "python/map.h"
+#include "python/repeated.h"
+#include "upb/message/copy.h"
+#include "upb/reflection/def.h"
+#include "upb/reflection/message.h"
+#include "upb/text/encode.h"
+#include "upb/util/required_fields.h"
 
 static const upb_MessageDef* PyUpb_MessageMeta_GetMsgdef(PyObject* cls);
 static PyObject* PyUpb_MessageMeta_GetAttr(PyObject* self, PyObject* name);
diff --git a/upb/python/message.h b/python/message.h
similarity index 98%
rename from upb/python/message.h
rename to python/message.h
index eb673a7..d497f61 100644
--- a/upb/python/message.h
+++ b/python/message.h
@@ -33,8 +33,8 @@
 
 #include <stdbool.h>
 
-#include "upb/python/protobuf.h"
-#include "upb/upb/reflection/message.h"
+#include "python/protobuf.h"
+#include "upb/reflection/message.h"
 
 // Removes the wrapper object for this field from the unset subobject cache.
 void PyUpb_Message_CacheDelete(PyObject* _self, const upb_FieldDef* f);
diff --git a/upb/python/minimal_test.py b/python/minimal_test.py
similarity index 100%
rename from upb/python/minimal_test.py
rename to python/minimal_test.py
diff --git a/upb/python/pb_unit_tests/BUILD b/python/pb_unit_tests/BUILD
similarity index 95%
rename from upb/python/pb_unit_tests/BUILD
rename to python/pb_unit_tests/BUILD
index 8aecac9..56ee250 100644
--- a/upb/python/pb_unit_tests/BUILD
+++ b/python/pb_unit_tests/BUILD
@@ -42,7 +42,7 @@
     deps = [
       requirement("numpy"),
       "//python/google/protobuf/internal/numpy:numpy_test",
-      "//upb/python:_message",
+      "//python:_message",
     ],
     target_compatible_with = select({
       "@system_python//:supported": [],
@@ -79,6 +79,6 @@
     name = "test_files",
     srcs = glob(["*.py"]),
     visibility = [
-        "//upb/python/dist:__pkg__",  # Scheuklappen: keep
+        "//python/dist:__pkg__",  # Scheuklappen: keep
     ],
 )
diff --git a/upb/python/pb_unit_tests/README.md b/python/pb_unit_tests/README.md
similarity index 100%
rename from upb/python/pb_unit_tests/README.md
rename to python/pb_unit_tests/README.md
diff --git a/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py b/python/pb_unit_tests/descriptor_database_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/descriptor_database_test_wrapper.py
rename to python/pb_unit_tests/descriptor_database_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py b/python/pb_unit_tests/descriptor_pool_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py
rename to python/pb_unit_tests/descriptor_pool_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/descriptor_test_wrapper.py b/python/pb_unit_tests/descriptor_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/descriptor_test_wrapper.py
rename to python/pb_unit_tests/descriptor_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/generator_test_wrapper.py b/python/pb_unit_tests/generator_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/generator_test_wrapper.py
rename to python/pb_unit_tests/generator_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/json_format_test_wrapper.py b/python/pb_unit_tests/json_format_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/json_format_test_wrapper.py
rename to python/pb_unit_tests/json_format_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/keywords_test_wrapper.py b/python/pb_unit_tests/keywords_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/keywords_test_wrapper.py
rename to python/pb_unit_tests/keywords_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/message_factory_test_wrapper.py b/python/pb_unit_tests/message_factory_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/message_factory_test_wrapper.py
rename to python/pb_unit_tests/message_factory_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/message_test_wrapper.py b/python/pb_unit_tests/message_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/message_test_wrapper.py
rename to python/pb_unit_tests/message_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/numpy_test_wrapper.py b/python/pb_unit_tests/numpy_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/numpy_test_wrapper.py
rename to python/pb_unit_tests/numpy_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/proto_builder_test_wrapper.py b/python/pb_unit_tests/proto_builder_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/proto_builder_test_wrapper.py
rename to python/pb_unit_tests/proto_builder_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl b/python/pb_unit_tests/pyproto_test_wrapper.bzl
similarity index 96%
rename from upb/python/pb_unit_tests/pyproto_test_wrapper.bzl
rename to python/pb_unit_tests/pyproto_test_wrapper.bzl
index a6a31b3..5691e88 100644
--- a/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl
+++ b/python/pb_unit_tests/pyproto_test_wrapper.bzl
@@ -9,7 +9,7 @@
         main = src,
         data = ["//src/google/protobuf:testdata"],
         deps = [
-            "//upb/python:_message",
+            "//python:_message",
             "//:python_common_test_protos",
             "//:python_specific_test_protos",
             "//:python_test_srcs",
diff --git a/upb/python/pb_unit_tests/reflection_test_wrapper.py b/python/pb_unit_tests/reflection_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/reflection_test_wrapper.py
rename to python/pb_unit_tests/reflection_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/service_reflection_test_wrapper.py b/python/pb_unit_tests/service_reflection_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/service_reflection_test_wrapper.py
rename to python/pb_unit_tests/service_reflection_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/symbol_database_test_wrapper.py b/python/pb_unit_tests/symbol_database_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/symbol_database_test_wrapper.py
rename to python/pb_unit_tests/symbol_database_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/text_encoding_test_wrapper.py b/python/pb_unit_tests/text_encoding_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/text_encoding_test_wrapper.py
rename to python/pb_unit_tests/text_encoding_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/text_format_test_wrapper.py b/python/pb_unit_tests/text_format_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/text_format_test_wrapper.py
rename to python/pb_unit_tests/text_format_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py b/python/pb_unit_tests/unknown_fields_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/unknown_fields_test_wrapper.py
rename to python/pb_unit_tests/unknown_fields_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/well_known_types_test_wrapper.py b/python/pb_unit_tests/well_known_types_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/well_known_types_test_wrapper.py
rename to python/pb_unit_tests/well_known_types_test_wrapper.py
diff --git a/upb/python/pb_unit_tests/wire_format_test_wrapper.py b/python/pb_unit_tests/wire_format_test_wrapper.py
similarity index 100%
rename from upb/python/pb_unit_tests/wire_format_test_wrapper.py
rename to python/pb_unit_tests/wire_format_test_wrapper.py
diff --git a/upb/python/protobuf.c b/python/protobuf.c
similarity index 97%
rename from upb/python/protobuf.c
rename to python/protobuf.c
index 79b2e3f..324b1ed 100644
--- a/upb/python/protobuf.c
+++ b/python/protobuf.c
@@ -28,16 +28,16 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/python/protobuf.h"
+#include "python/protobuf.h"
 
-#include "upb/python/descriptor.h"
-#include "upb/python/descriptor_containers.h"
-#include "upb/python/descriptor_pool.h"
-#include "upb/python/extension_dict.h"
-#include "upb/python/map.h"
-#include "upb/python/message.h"
-#include "upb/python/repeated.h"
-#include "upb/python/unknown_fields.h"
+#include "python/descriptor.h"
+#include "python/descriptor_containers.h"
+#include "python/descriptor_pool.h"
+#include "python/extension_dict.h"
+#include "python/map.h"
+#include "python/message.h"
+#include "python/repeated.h"
+#include "python/unknown_fields.h"
 
 static upb_Arena* PyUpb_NewArena(void);
 
diff --git a/upb/python/protobuf.h b/python/protobuf.h
similarity index 96%
rename from upb/python/protobuf.h
rename to python/protobuf.h
index 8ed2d2d..e9839be 100644
--- a/upb/python/protobuf.h
+++ b/python/protobuf.h
@@ -33,9 +33,9 @@
 
 #include <stdbool.h>
 
-#include "upb/python/descriptor.h"
-#include "upb/python/python_api.h"
-#include "upb/upb/hash/int_table.h"
+#include "python/descriptor.h"
+#include "python/python_api.h"
+#include "upb/hash/int_table.h"
 
 // begin:github_only
 #define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google.protobuf"
@@ -45,8 +45,8 @@
 // end:github_only
 
 // begin:google_only
-// #define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google3.net.proto2.python.public"
-// #define PYUPB_PROTOBUF_INTERNAL_PACKAGE "google3.net.proto2.python.internal"
+// #define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google3.net.google.protobuf.python.public"
+// #define PYUPB_PROTOBUF_INTERNAL_PACKAGE "google3.net.google.protobuf.python.internal"
 // #define PYUPB_DESCRIPTOR_PROTO_PACKAGE "proto2"
 // #define PYUPB_MODULE_NAME "google3.third_party.upb.python._message"
 // end:google_only
diff --git a/python/py_extension.bzl b/python/py_extension.bzl
new file mode 100644
index 0000000..7b918bc
--- /dev/null
+++ b/python/py_extension.bzl
@@ -0,0 +1,60 @@
+"""Macro to support py_extension """
+
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+def py_extension(name, srcs, copts, deps = [], **kwargs):
+    """Creates a C++ library to extend python
+
+    Args:
+      name: Name of the target
+      srcs: List of source files to create the target
+      copts: List of C++ compile options to use
+      deps: Libraries that the target depends on
+    """
+
+    native.cc_binary(
+        name = name + "_binary",
+        srcs = srcs,
+        copts = copts + ["-fvisibility=hidden"],
+        linkopts = selects.with_or({
+            (
+                "//python/dist:osx_x86_64",
+                "//python/dist:osx_aarch64",
+            ): ["-undefined", "dynamic_lookup"],
+            "//python/dist:windows_x86_32": ["-static-libgcc"],
+            "//conditions:default": [],
+        }),
+        linkshared = True,
+        linkstatic = True,
+        deps = deps + select({
+            "//python:limited_api_3.7": ["@python-3.7.0//:python_headers"],
+            "//python:full_api_3.7_win32": ["@nuget_python_i686_3.7.0//:python_full_api"],
+            "//python:full_api_3.7_win64": ["@nuget_python_x86-64_3.7.0//:python_full_api"],
+            "//python:full_api_3.8_win32": ["@nuget_python_i686_3.8.0//:python_full_api"],
+            "//python:full_api_3.8_win64": ["@nuget_python_x86-64_3.8.0//:python_full_api"],
+            "//python:full_api_3.9_win32": ["@nuget_python_i686_3.9.0//:python_full_api"],
+            "//python:full_api_3.9_win64": ["@nuget_python_x86-64_3.9.0//:python_full_api"],
+            "//python:limited_api_3.10_win32": ["@nuget_python_i686_3.10.0//:python_limited_api"],
+            "//python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"],
+            "//conditions:default": ["@system_python//:python_headers"],
+        }),
+        **kwargs
+    )
+
+    EXT_SUFFIX = ".abi3.so"
+    output_file = "google/_upb/" + name + EXT_SUFFIX
+
+    native.genrule(
+        name = "copy" + name,
+        srcs = [":" + name + "_binary"],
+        outs = [output_file],
+        cmd = "cp $< $@",
+        visibility = ["//python:__subpackages__"],
+    )
+
+    native.py_library(
+        name = name,
+        data = [output_file],
+        imports = ["."],
+        visibility = ["//python:__subpackages__"],
+    )
diff --git a/upb/python/python_api.h b/python/python_api.h
similarity index 100%
rename from upb/python/python_api.h
rename to python/python_api.h
diff --git a/upb/python/repeated.c b/python/repeated.c
similarity index 99%
rename from upb/python/repeated.c
rename to python/repeated.c
index 656b42c..abb34e8 100644
--- a/upb/python/repeated.c
+++ b/python/repeated.c
@@ -28,11 +28,11 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/python/repeated.h"
+#include "python/repeated.h"
 
-#include "upb/python/convert.h"
-#include "upb/python/message.h"
-#include "upb/python/protobuf.h"
+#include "python/convert.h"
+#include "python/message.h"
+#include "python/protobuf.h"
 
 static PyObject* PyUpb_RepeatedCompositeContainer_Append(PyObject* _self,
                                                          PyObject* value);
diff --git a/upb/python/repeated.h b/python/repeated.h
similarity index 97%
rename from upb/python/repeated.h
rename to python/repeated.h
index 413e4f1..54670e7 100644
--- a/upb/python/repeated.h
+++ b/python/repeated.h
@@ -33,8 +33,8 @@
 
 #include <stdbool.h>
 
-#include "upb/python/python_api.h"
-#include "upb/upb/reflection/def.h"
+#include "python/python_api.h"
+#include "upb/reflection/def.h"
 
 // Creates a new repeated field stub for field `f` of message object `parent`.
 // Precondition: `parent` must be a stub.
diff --git a/upb/python/requirements.txt b/python/requirements.txt
similarity index 100%
rename from upb/python/requirements.txt
rename to python/requirements.txt
diff --git a/upb/python/unknown_fields.c b/python/unknown_fields.c
similarity index 97%
rename from upb/python/unknown_fields.c
rename to python/unknown_fields.c
index 65a1383..f228f23 100644
--- a/upb/python/unknown_fields.c
+++ b/python/unknown_fields.c
@@ -28,13 +28,13 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/python/unknown_fields.h"
+#include "python/unknown_fields.h"
 
-#include "upb/python/message.h"
-#include "upb/python/protobuf.h"
-#include "upb/upb/wire/eps_copy_input_stream.h"
-#include "upb/upb/wire/reader.h"
-#include "upb/upb/wire/types.h"
+#include "python/message.h"
+#include "python/protobuf.h"
+#include "upb/wire/eps_copy_input_stream.h"
+#include "upb/wire/reader.h"
+#include "upb/wire/types.h"
 
 // -----------------------------------------------------------------------------
 // UnknownFieldSet
diff --git a/upb/python/unknown_fields.h b/python/unknown_fields.h
similarity index 97%
rename from upb/python/unknown_fields.h
rename to python/unknown_fields.h
index 72bf2e9..85ea40c 100644
--- a/upb/python/unknown_fields.h
+++ b/python/unknown_fields.h
@@ -33,7 +33,7 @@
 
 #include <stdbool.h>
 
-#include "upb/python/python_api.h"
+#include "python/python_api.h"
 
 PyObject* PyUpb_UnknownFields_New(PyObject* msg);
 
diff --git a/upb/python/version_script.lds b/python/version_script.lds
similarity index 100%
rename from upb/python/version_script.lds
rename to python/version_script.lds
diff --git a/ruby/compatibility_tests/v3.0.0/BUILD.bazel b/ruby/compatibility_tests/v3.0.0/BUILD.bazel
index d62c352..60c4985 100644
--- a/ruby/compatibility_tests/v3.0.0/BUILD.bazel
+++ b/ruby/compatibility_tests/v3.0.0/BUILD.bazel
@@ -23,11 +23,11 @@
 pkg_files(
     name = "dist_files",
     srcs = [
-        "//ruby/compatibility_tests/v3.0.0/tests:dist_files",
         "BUILD.bazel",
-        "Rakefile",
         "README.md",
+        "Rakefile",
         "test.sh",
+        "//ruby/compatibility_tests/v3.0.0/tests:dist_files",
     ],
     strip_prefix = strip_prefix.from_root(""),
     visibility = ["//pkg:__pkg__"],
diff --git a/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel b/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel
index e165b0b..34a5391 100644
--- a/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel
+++ b/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel
@@ -11,42 +11,42 @@
 
 ruby_test(
     name = "basic",
+    srcs = ["basic.rb"],
     deps = [
         ":test_ruby_protos",
         "//ruby:protobuf",
-        "@protobuf_bundle//:test-unit"
+        "@protobuf_bundle//:test-unit",
     ],
-    srcs = ["basic.rb"],
 )
 
 ruby_test(
     name = "generated_code_test",
+    srcs = ["generated_code_test.rb"],
     deps = [
         ":test_ruby_protos",
         "//ruby:protobuf",
-        "@protobuf_bundle//:test-unit"
+        "@protobuf_bundle//:test-unit",
     ],
-    srcs = ["generated_code_test.rb"],
 )
 
 ruby_test(
     name = "repeated_field_test",
+    srcs = ["repeated_field_test.rb"],
     deps = [
         ":test_ruby_protos",
         "//ruby:protobuf",
-        "@protobuf_bundle//:test-unit"
+        "@protobuf_bundle//:test-unit",
     ],
-    srcs = ["repeated_field_test.rb"],
 )
 
 ruby_test(
     name = "stress",
+    srcs = ["stress.rb"],
     deps = [
         ":test_ruby_protos",
         "//ruby:protobuf",
-        "@protobuf_bundle//:test-unit"
+        "@protobuf_bundle//:test-unit",
     ],
-    srcs = ["stress.rb"],
 )
 
 ################################################################################
@@ -57,7 +57,7 @@
     name = "dist_files",
     srcs = glob([
         "**/*.rb",
-        "**/*.proto"
+        "**/*.proto",
     ]),
     strip_prefix = strip_prefix.from_root(""),
     visibility = ["//ruby/compatibility_tests/v3.0.0:__pkg__"],
diff --git a/ruby/src/main/java/BUILD.bazel b/ruby/src/main/java/BUILD.bazel
index 34242d4..4394534 100644
--- a/ruby/src/main/java/BUILD.bazel
+++ b/ruby/src/main/java/BUILD.bazel
@@ -5,20 +5,20 @@
 java_library(
     name = "protobuf_java",
     srcs = glob([
-        "com/google/protobuf/jruby/*.java"
+        "com/google/protobuf/jruby/*.java",
     ]) + [
-        "google/ProtobufJavaService.java"
-    ],
-    deps = [
-        "@rules_ruby//ruby/runtime:jars",
-        "//java/core",
-        "//java/util",
+        "google/ProtobufJavaService.java",
     ],
     target_compatible_with = select({
         "@rules_ruby//ruby/runtime:config_jruby": [],
         "//conditions:default": ["@platforms//:incompatible"],
     }),
     visibility = ["//ruby:__subpackages__"],
+    deps = [
+        "//java/core",
+        "//java/util",
+        "@rules_ruby//ruby/runtime:jars",
+    ],
 )
 
 proto_library(
@@ -31,7 +31,6 @@
     deps = [":sentinel_proto"],
 )
 
-
 pkg_files(
     name = "dist_files",
     srcs = glob([
diff --git a/rust/aspects.bzl b/rust/aspects.bzl
index 7e68a12..d0c877d 100644
--- a/rust/aspects.bzl
+++ b/rust/aspects.bzl
@@ -9,7 +9,7 @@
 # buildifier: disable=bzl-visibility
 load("@rules_rust//rust/private:rustc.bzl", "rustc_compile_action")
 load("@rules_rust//rust:defs.bzl", "rust_common")
-load("//upb/bazel:upb_proto_library.bzl", "UpbWrappedCcInfo", "upb_proto_library_aspect")
+load("//bazel:upb_proto_library.bzl", "UpbWrappedCcInfo", "upb_proto_library_aspect")
 load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
 
 proto_common = proto_common_do_not_use
diff --git a/rust/cpp_kernel/BUILD b/rust/cpp_kernel/BUILD
index 0b9594b..9d9c5bf 100644
--- a/rust/cpp_kernel/BUILD
+++ b/rust/cpp_kernel/BUILD
@@ -11,7 +11,7 @@
     ],
     deps = [
         ":rust_alloc_for_cpp_api",
-        "//src/google/protobuf",
+        "//:protobuf",
     ],
 )
 
diff --git a/rust/test/cpp/interop/BUILD b/rust/test/cpp/interop/BUILD
index 5cbd993..1a4d88d 100644
--- a/rust/test/cpp/interop/BUILD
+++ b/rust/test/cpp/interop/BUILD
@@ -6,7 +6,7 @@
     name = "test_utils",
     srcs = ["test_utils.cc"],
     deps = [
-        "//third_party/absl/strings",
+        "@com_google_absl//absl/strings",
         "//rust/cpp_kernel:cpp_api",
         "//rust/test:unittest_cc_proto",
     ],
diff --git a/rust/upb_kernel/upb_api.c b/rust/upb_kernel/upb_api.c
index c4eb226..985749d 100644
--- a/rust/upb_kernel/upb_api.c
+++ b/rust/upb_kernel/upb_api.c
@@ -8,4 +8,4 @@
 
 #define UPB_BUILD_API
 
-#include "upb/upb/mem/arena.h" // IWYU pragma: keep
+#include "upb/mem/arena.h" // IWYU pragma: keep
diff --git a/src/BUILD.bazel b/src/BUILD.bazel
index 96b7001..2ce3449 100644
--- a/src/BUILD.bazel
+++ b/src/BUILD.bazel
@@ -49,8 +49,8 @@
     srcs = ["//pkg:gen_src_file_lists"],
     outs = ["cmake_copy/file_lists.cmake"],
     cmd = "cp $< $@",
-    visibility = ["//visibility:private"],
     tags = ["manual"],
+    visibility = ["//visibility:private"],
 )
 
 staleness_test(
diff --git a/src/google/protobuf/BUILD.bazel b/src/google/protobuf/BUILD.bazel
index 328e822..b1542e9 100644
--- a/src/google/protobuf/BUILD.bazel
+++ b/src/google/protobuf/BUILD.bazel
@@ -5,8 +5,8 @@
 load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library", "cc_test")
 load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
 load("@rules_proto//proto:defs.bzl", "proto_library")
-load("//upb/cmake:build_defs.bzl", "staleness_test")
 load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS")
+load("//upb/cmake:build_defs.bzl", "staleness_test")
 
 package(
     default_visibility = [
@@ -786,6 +786,8 @@
     visibility = [
         "//:__pkg__",
         "//conformance:__pkg__",
+        "//lua:__subpackages__",
+        "//python:__subpackages__",
         "//upb:__subpackages__",
     ],
 )
@@ -797,6 +799,8 @@
     visibility = [
         "//:__pkg__",
         "//conformance:__pkg__",
+        "//lua:__subpackages__",
+        "//python:__subpackages__",
         "//upb:__subpackages__",
     ],
     deps = [
diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel
index 87e0753..d1c43cd 100644
--- a/src/google/protobuf/compiler/BUILD.bazel
+++ b/src/google/protobuf/compiler/BUILD.bazel
@@ -212,7 +212,7 @@
     name = "plugin_proto_src",
     srcs = ["plugin.proto"],
     visibility = [
-        "//upb:__subpackages__",
+        "//upbc:__subpackages__",
         # For compatibility with workspaces that still use the old upb repo
         "@upb//:__subpackages__",
     ],
diff --git a/src/google/protobuf/compiler/allowlists/BUILD.bazel b/src/google/protobuf/compiler/allowlists/BUILD.bazel
index 9c457f4..ebedfad 100644
--- a/src/google/protobuf/compiler/allowlists/BUILD.bazel
+++ b/src/google/protobuf/compiler/allowlists/BUILD.bazel
@@ -57,4 +57,4 @@
         allow_empty = True,
     ),
     visibility = ["//src/google/protobuf/compiler:__pkg__"],
-)
\ No newline at end of file
+)
diff --git a/src/google/protobuf/compiler/objectivec/BUILD.bazel b/src/google/protobuf/compiler/objectivec/BUILD.bazel
index 8ca54ee..5ab3381 100644
--- a/src/google/protobuf/compiler/objectivec/BUILD.bazel
+++ b/src/google/protobuf/compiler/objectivec/BUILD.bazel
@@ -155,9 +155,12 @@
 
 filegroup(
     name = "test_srcs",
-    srcs = glob([
-        "*_test.cc",
-        "*unittest.cc",
-    ], allow_empty = True),
+    srcs = glob(
+        [
+            "*_test.cc",
+            "*unittest.cc",
+        ],
+        allow_empty = True,
+    ),
     visibility = ["//src/google/protobuf/compiler:__pkg__"],
 )
diff --git a/src/google/protobuf/compiler/ruby/BUILD.bazel b/src/google/protobuf/compiler/ruby/BUILD.bazel
index 2aee20e..d01764c 100644
--- a/src/google/protobuf/compiler/ruby/BUILD.bazel
+++ b/src/google/protobuf/compiler/ruby/BUILD.bazel
@@ -64,9 +64,12 @@
 
 filegroup(
     name = "test_srcs",
-    srcs = glob([
-        "*_test.cc",
-        "*unittest.cc",
-    ], allow_empty = True),
+    srcs = glob(
+        [
+            "*_test.cc",
+            "*unittest.cc",
+        ],
+        allow_empty = True,
+    ),
     visibility = ["//src/google/protobuf/compiler:__pkg__"],
 )
diff --git a/src/google/protobuf/editions/BUILD b/src/google/protobuf/editions/BUILD
index 7add8dc..cd38e08 100644
--- a/src/google/protobuf/editions/BUILD
+++ b/src/google/protobuf/editions/BUILD
@@ -56,7 +56,7 @@
         ":test_editions_default_features_cc_proto",
         ":test_messages_proto2_cc_proto",
         ":test_messages_proto3_cc_proto",
-        "//src/google/protobuf",
+        "//:protobuf",
         "//src/google/protobuf:test_textproto",
         "@com_google_googletest//:gtest_main",
     ],
diff --git a/src/google/protobuf/io/BUILD.bazel b/src/google/protobuf/io/BUILD.bazel
index 5888a90..0578742 100644
--- a/src/google/protobuf/io/BUILD.bazel
+++ b/src/google/protobuf/io/BUILD.bazel
@@ -142,7 +142,7 @@
         "@com_google_absl//absl/log:absl_log",
     ] + select({
         "//build_defs:config_msvc": [],
-        "//conditions:default": ["@zlib//:zlib"],
+        "//conditions:default": ["@zlib"],
     }),
 )
 
diff --git a/src/google/protobuf/json/BUILD.bazel b/src/google/protobuf/json/BUILD.bazel
index d6019f9..dece74e 100644
--- a/src/google/protobuf/json/BUILD.bazel
+++ b/src/google/protobuf/json/BUILD.bazel
@@ -141,9 +141,9 @@
 
 cc_test(
     name = "lexer_test",
+    timeout = "long",
     srcs = ["internal/lexer_test.cc"],
     copts = COPTS,
-    timeout = "long",
     deps = [
         ":lexer",
         ":test_input_stream",
diff --git a/src/google/protobuf/stubs/BUILD.bazel b/src/google/protobuf/stubs/BUILD.bazel
index c8fc3e9..740e43e 100644
--- a/src/google/protobuf/stubs/BUILD.bazel
+++ b/src/google/protobuf/stubs/BUILD.bazel
@@ -92,9 +92,12 @@
 
 filegroup(
     name = "test_srcs",
-    srcs = glob([
-        "*_test.cc",
-        "*unittest.cc",
-    ], allow_empty = True),
+    srcs = glob(
+        [
+            "*_test.cc",
+            "*unittest.cc",
+        ],
+        allow_empty = True,
+    ),
     visibility = ["//pkg:__pkg__"],
 )
diff --git a/upb/BUILD b/upb/BUILD
index 0eac0e5..9f1cf4b 100644
--- a/upb/BUILD
+++ b/upb/BUILD
@@ -7,12 +7,12 @@
 
 load("@rules_python//python:defs.bzl", "py_binary")
 load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
-load("//upb/bazel:upb_minitable_proto_library.bzl", "upb_minitable_proto_library")
-load("//upb/bazel:upb_proto_library.bzl", "upb_proto_reflection_library")
-load("//upb/bazel:upb_proto_library_internal/copts.bzl", "upb_proto_library_copts")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:upb_minitable_proto_library.bzl", "upb_minitable_proto_library")
+load("//bazel:upb_proto_library.bzl", "upb_proto_reflection_library")
+load("//bazel:upb_proto_library_internal/copts.bzl", "upb_proto_library_copts")
 load(
-    "//upb/upbc:bootstrap_compiler.bzl",
+    "//upbc:bootstrap_compiler.bzl",
     "bootstrap_cc_library",
     "bootstrap_upb_proto_library",
 )
@@ -24,7 +24,7 @@
 
 # begin:github_only
 load(
-    "//upb/bazel:amalgamation.bzl",
+    "//bazel:amalgamation.bzl",
     "upb_amalgamation",
 )
 # end:github_only
@@ -86,7 +86,7 @@
 cc_library(
     name = "upb",
     hdrs = [
-        "upb/upb.hpp",
+        "upb.hpp",
     ],
     copts = UPB_DEFAULT_COPTS,
     visibility = ["//visibility:public"],
@@ -104,10 +104,10 @@
 # give up any backward compatibility guarantees.
 cc_library(
     name = "generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
-    hdrs = ["upb/generated_code_support.h"],
+    hdrs = ["generated_code_support.h"],
     copts = UPB_DEFAULT_COPTS,
     textual_hdrs = [
-        "//upb/upb/port:inc",
+        "//upb/port:inc",
     ],
     visibility = ["//visibility:public"],
     deps = [
@@ -131,7 +131,7 @@
     name = "generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
     copts = UPB_DEFAULT_COPTS,
     textual_hdrs = [
-        "//upb/upb/port:inc",
+        "//upb/port:inc",
     ],
     visibility = ["//visibility:public"],
 )
@@ -139,12 +139,12 @@
 cc_library(
     name = "generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
     hdrs = [
-        "upb/reflection/def.h",
-        "upb/reflection/internal/def_pool.h",
+        "reflection/def.h",
+        "reflection/internal/def_pool.h",
     ],
     copts = UPB_DEFAULT_COPTS,
     textual_hdrs = [
-        "//upb/upb/port:inc",
+        "//upb/port:inc",
     ],
     visibility = ["//visibility:public"],
     deps = [
@@ -156,7 +156,7 @@
 
 bootstrap_upb_proto_library(
     name = "descriptor_upb_proto",
-    base_dir = "upb/reflection/",
+    base_dir = "reflection/",
     # TODO: Export 'net/proto2/proto/descriptor.upb.h' and remove "-layering_check".
     features = ["-layering_check"],
     google3_src_files = ["net/proto2/proto/descriptor.proto"],
@@ -176,7 +176,12 @@
 
 upb_minitable_proto_library(
     name = "descriptor_upb_minitable_proto",
-    visibility = ["//upb:__subpackages__"],
+    visibility = [
+        "//upb:__subpackages__",
+        # begin:github_only
+        "//python:__subpackages__",
+        # end:github_only
+    ],
     deps = ["//:descriptor_proto"],
 )
 
@@ -185,10 +190,10 @@
 bootstrap_cc_library(
     name = "reflection",
     hdrs = [
-        "upb/reflection/def.h",
-        "upb/reflection/def.hpp",
-        "upb/reflection/message.h",
-        "upb/reflection/message.hpp",
+        "reflection/def.h",
+        "reflection/def.hpp",
+        "reflection/message.h",
+        "reflection/message.hpp",
     ],
     bootstrap_deps = [":reflection_internal"],
     copts = UPB_DEFAULT_COPTS,
@@ -206,58 +211,58 @@
 bootstrap_cc_library(
     name = "reflection_internal",
     srcs = [
-        "upb/reflection/def_pool.c",
-        "upb/reflection/def_type.c",
-        "upb/reflection/desc_state.c",
-        "upb/reflection/enum_def.c",
-        "upb/reflection/enum_reserved_range.c",
-        "upb/reflection/enum_value_def.c",
-        "upb/reflection/extension_range.c",
-        "upb/reflection/field_def.c",
-        "upb/reflection/file_def.c",
-        "upb/reflection/internal/def_builder.c",
-        "upb/reflection/internal/def_builder.h",
-        "upb/reflection/internal/strdup2.c",
-        "upb/reflection/internal/strdup2.h",
-        "upb/reflection/message.c",
-        "upb/reflection/message_def.c",
-        "upb/reflection/message_reserved_range.c",
-        "upb/reflection/method_def.c",
-        "upb/reflection/oneof_def.c",
-        "upb/reflection/service_def.c",
+        "reflection/def_pool.c",
+        "reflection/def_type.c",
+        "reflection/desc_state.c",
+        "reflection/enum_def.c",
+        "reflection/enum_reserved_range.c",
+        "reflection/enum_value_def.c",
+        "reflection/extension_range.c",
+        "reflection/field_def.c",
+        "reflection/file_def.c",
+        "reflection/internal/def_builder.c",
+        "reflection/internal/def_builder.h",
+        "reflection/internal/strdup2.c",
+        "reflection/internal/strdup2.h",
+        "reflection/message.c",
+        "reflection/message_def.c",
+        "reflection/message_reserved_range.c",
+        "reflection/method_def.c",
+        "reflection/oneof_def.c",
+        "reflection/service_def.c",
     ],
     hdrs = [
-        "upb/reflection/common.h",
-        "upb/reflection/def.h",
-        "upb/reflection/def.hpp",
-        "upb/reflection/def_pool.h",
-        "upb/reflection/def_type.h",
-        "upb/reflection/enum_def.h",
-        "upb/reflection/enum_reserved_range.h",
-        "upb/reflection/enum_value_def.h",
-        "upb/reflection/extension_range.h",
-        "upb/reflection/field_def.h",
-        "upb/reflection/file_def.h",
-        "upb/reflection/internal/def_pool.h",
-        "upb/reflection/internal/desc_state.h",
-        "upb/reflection/internal/enum_def.h",
-        "upb/reflection/internal/enum_reserved_range.h",
-        "upb/reflection/internal/enum_value_def.h",
-        "upb/reflection/internal/extension_range.h",
-        "upb/reflection/internal/field_def.h",
-        "upb/reflection/internal/file_def.h",
-        "upb/reflection/internal/message_def.h",
-        "upb/reflection/internal/message_reserved_range.h",
-        "upb/reflection/internal/method_def.h",
-        "upb/reflection/internal/oneof_def.h",
-        "upb/reflection/internal/service_def.h",
-        "upb/reflection/message.h",
-        "upb/reflection/message.hpp",
-        "upb/reflection/message_def.h",
-        "upb/reflection/message_reserved_range.h",
-        "upb/reflection/method_def.h",
-        "upb/reflection/oneof_def.h",
-        "upb/reflection/service_def.h",
+        "reflection/common.h",
+        "reflection/def.h",
+        "reflection/def.hpp",
+        "reflection/def_pool.h",
+        "reflection/def_type.h",
+        "reflection/enum_def.h",
+        "reflection/enum_reserved_range.h",
+        "reflection/enum_value_def.h",
+        "reflection/extension_range.h",
+        "reflection/field_def.h",
+        "reflection/file_def.h",
+        "reflection/internal/def_pool.h",
+        "reflection/internal/desc_state.h",
+        "reflection/internal/enum_def.h",
+        "reflection/internal/enum_reserved_range.h",
+        "reflection/internal/enum_value_def.h",
+        "reflection/internal/extension_range.h",
+        "reflection/internal/field_def.h",
+        "reflection/internal/file_def.h",
+        "reflection/internal/message_def.h",
+        "reflection/internal/message_reserved_range.h",
+        "reflection/internal/method_def.h",
+        "reflection/internal/oneof_def.h",
+        "reflection/internal/service_def.h",
+        "reflection/message.h",
+        "reflection/message.hpp",
+        "reflection/message_def.h",
+        "reflection/message_reserved_range.h",
+        "reflection/method_def.h",
+        "reflection/oneof_def.h",
+        "reflection/service_def.h",
     ],
     bootstrap_deps = [":descriptor_upb_proto"],
     copts = UPB_DEFAULT_COPTS,
@@ -283,199 +288,199 @@
 
 alias(
     name = "base",
-    actual = "//upb/upb/base",
+    actual = "//upb/base",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "base_internal",
-    actual = "//upb/upb/base:internal",
+    actual = "//upb/base:internal",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "collections",
-    actual = "//upb/upb/collections",
+    actual = "//upb/collections",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "collections_internal",
-    actual = "//upb/upb/collections:internal",
+    actual = "//upb/collections:internal",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "collections_split64",
-    actual = "//upb/upb/collections:split64",
+    actual = "//upb/collections:split64",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "hash",
-    actual = "//upb/upb/hash",
+    actual = "//upb/hash",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "json",
-    actual = "//upb/upb/json",
+    actual = "//upb/json",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "lex",
-    actual = "//upb/upb/lex",
+    actual = "//upb/lex",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "mem",
-    actual = "//upb/upb/mem",
+    actual = "//upb/mem",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "mem_internal",
-    actual = "//upb/upb/mem:internal",
+    actual = "//upb/mem:internal",
     visibility = ["//upb:__subpackages__"],
 )
 
 alias(
     name = "message",
-    actual = "//upb/upb/message",
+    actual = "//upb/message",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "message_accessors",
-    actual = "//upb/upb/message:accessors",
+    actual = "//upb/message:accessors",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "message_accessors_internal",
-    actual = "//upb/upb/message:accessors_internal",
+    actual = "//upb/message:accessors_internal",
     visibility = ["//upb:friends"],
 )
 
 alias(
     name = "message_copy",
-    actual = "//upb/upb/message:copy",
+    actual = "//upb/message:copy",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "message_internal",
-    actual = "//upb/upb/message:internal",
+    actual = "//upb/message:internal",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "message_internal_types",
-    actual = "//upb/upb/message:internal_types",
+    actual = "//upb/message:internal_types",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "message_promote",
-    actual = "//upb/upb/message:promote",
+    actual = "//upb/message:promote",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "message_split64",
-    actual = "//upb/upb/message:split64",
+    actual = "//upb/message:split64",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "message_tagged_ptr",
-    actual = "//upb/upb/message:tagged_ptr",
+    actual = "//upb/message:tagged_ptr",
     visibility = ["//upb:friends"],
 )
 
 alias(
     name = "message_types",
-    actual = "//upb/upb/message:types",
+    actual = "//upb/message:types",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "message_value",
-    actual = "//upb/upb/message:value",
+    actual = "//upb/message:value",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "mini_descriptor",
-    actual = "//upb/upb/mini_descriptor",
+    actual = "//upb/mini_descriptor",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "mini_descriptor_internal",
-    actual = "//upb/upb/mini_descriptor:internal",
+    actual = "//upb/mini_descriptor:internal",
     visibility = ["//upb:__subpackages__"],
 )
 
 alias(
     name = "mini_table",
-    actual = "//upb/upb/mini_table",
+    actual = "//upb/mini_table",
     visibility = ["//upb:friends"],
 )
 
 alias(
     name = "mini_table_compat",
-    actual = "//upb/upb/mini_table:compat",
+    actual = "//upb/mini_table:compat",
     visibility = ["//upb:friends"],
 )
 
 alias(
     name = "mini_table_internal",
-    actual = "//upb/upb/mini_table:internal",
+    actual = "//upb/mini_table:internal",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "port",
-    actual = "//upb/upb/port",
+    actual = "//upb/port",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "text",
-    actual = "//upb/upb/text",
+    actual = "//upb/text",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "wire",
-    actual = "//upb/upb/wire",
+    actual = "//upb/wire",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "wire_internal",
-    actual = "//upb/upb/wire:internal",
+    actual = "//upb/wire:internal",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "wire_reader",
-    actual = "//upb/upb/wire:reader",
+    actual = "//upb/wire:reader",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "wire_types",
-    actual = "//upb/upb/wire:types",
+    actual = "//upb/wire:types",
     visibility = ["//visibility:public"],
 )
 
 alias(
     name = "eps_copy_input_stream",
-    actual = "//upb/upb/wire:eps_copy_input_stream",
+    actual = "//upb/wire:eps_copy_input_stream",
     visibility = ["//visibility:public"],
 )
 
@@ -484,10 +489,10 @@
 cc_test(
     name = "def_builder_test",
     srcs = [
-        "upb/reflection/common.h",
-        "upb/reflection/def_type.h",
-        "upb/reflection/internal/def_builder.h",
-        "upb/reflection/internal/def_builder_test.cc",
+        "reflection/common.h",
+        "reflection/def_type.h",
+        "reflection/internal/def_builder.h",
+        "reflection/internal/def_builder_test.cc",
     ],
     deps = [
         ":descriptor_upb_proto",
@@ -496,8 +501,8 @@
         ":port",
         ":reflection",
         ":reflection_internal",
-        "@com_google_absl//absl/strings",
         "@com_google_googletest//:gtest_main",
+        "@com_google_absl//absl/strings",
     ],
 )
 
@@ -505,7 +510,7 @@
 
 cc_binary(
     name = "libupb.so",
-    srcs = ["upb/upb_so.c"],
+    srcs = ["upb_so.c"],
     copts = UPB_DEFAULT_COPTS + ["-DUPB_BUILD_API"],
     linkshared = 1,
     linkstatic = 1,
@@ -687,25 +692,25 @@
         "third_party/lunit/console.lua",
         "third_party/lunit/lunit.lua",
     ],
-    visibility = ["//upb/lua:__pkg__"],
+    visibility = ["//lua:__pkg__"],
 )
 
 filegroup(
     name = "source_files",
     srcs = glob(
         [
-            "upb/**/*.c",
-            "upb/**/*.h",
-            "upb/**/*.hpp",
+            "**/*.c",
+            "**/*.h",
+            "**/*.hpp",
        ],
         exclude = [
-            "upb/**/conformance_upb.c",
-            "upb/reflection/stage0/**/*",
+            "**/conformance_upb.c",
+            "reflection/stage0/**/*",
         ],
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/base/BUILD b/upb/base/BUILD
similarity index 91%
rename from upb/upb/base/BUILD
rename to upb/base/BUILD
index c64f9ad..54ef6d1 100644
--- a/upb/upb/base/BUILD
+++ b/upb/base/BUILD
@@ -5,7 +5,7 @@
 # license that can be found in the LICENSE file or at
 # https://developers.google.com/open-source/licenses/bsd
 
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 
 cc_library(
     name = "base",
@@ -47,7 +47,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/base/descriptor_constants.h b/upb/base/descriptor_constants.h
similarity index 96%
rename from upb/upb/base/descriptor_constants.h
rename to upb/base/descriptor_constants.h
index fd6d5e0..638649a 100644
--- a/upb/upb/base/descriptor_constants.h
+++ b/upb/base/descriptor_constants.h
@@ -9,7 +9,7 @@
 #define UPB_BASE_DESCRIPTOR_CONSTANTS_H_
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // The types a field can have. Note that this list is not identical to the
 // types defined in descriptor.proto, which gives INT32 and SINT32 separate
@@ -79,6 +79,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_BASE_DESCRIPTOR_CONSTANTS_H_ */
diff --git a/upb/upb/base/internal/log2.h b/upb/base/internal/log2.h
similarity index 92%
rename from upb/upb/base/internal/log2.h
rename to upb/base/internal/log2.h
index 3d5f381..486e3b0 100644
--- a/upb/upb/base/internal/log2.h
+++ b/upb/base/internal/log2.h
@@ -10,7 +10,7 @@
 #define UPB_BASE_INTERNAL_LOG2_H_
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -33,6 +33,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_BASE_INTERNAL_LOG2_H_ */
diff --git a/upb/upb/base/status.c b/upb/base/status.c
similarity index 96%
rename from upb/upb/base/status.c
rename to upb/base/status.c
index 83f059b..f2cd0a6 100644
--- a/upb/upb/base/status.c
+++ b/upb/base/status.c
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/base/status.h"
+#include "upb/base/status.h"
 
 #include <errno.h>
 #include <float.h>
@@ -14,7 +14,7 @@
 #include <string.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 void upb_Status_Clear(upb_Status* status) {
   if (!status) return;
diff --git a/upb/upb/base/status.h b/upb/base/status.h
similarity index 94%
rename from upb/upb/base/status.h
rename to upb/base/status.h
index adf9f17..5b75f88 100644
--- a/upb/upb/base/status.h
+++ b/upb/base/status.h
@@ -11,7 +11,7 @@
 #include <stdarg.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #define _kUpb_Status_MaxMessage 127
 
@@ -41,6 +41,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_BASE_STATUS_H_ */
diff --git a/upb/upb/base/status.hpp b/upb/base/status.hpp
similarity index 97%
rename from upb/upb/base/status.hpp
rename to upb/base/status.hpp
index f52ba69..4d7152b 100644
--- a/upb/upb/base/status.hpp
+++ b/upb/base/status.hpp
@@ -8,7 +8,7 @@
 #ifndef UPB_BASE_STATUS_HPP_
 #define UPB_BASE_STATUS_HPP_
 
-#include "upb/upb/base/status.h"
+#include "upb/base/status.h"
 
 namespace upb {
 
diff --git a/upb/upb/base/string_view.h b/upb/base/string_view.h
similarity index 95%
rename from upb/upb/base/string_view.h
rename to upb/base/string_view.h
index 5d2d967..28b1796 100644
--- a/upb/upb/base/string_view.h
+++ b/upb/base/string_view.h
@@ -11,7 +11,7 @@
 #include <string.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #define UPB_STRINGVIEW_INIT(ptr, len) \
   { ptr, len }
@@ -53,6 +53,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_BASE_STRING_VIEW_H_ */
diff --git a/upb/cmake/BUILD.bazel b/upb/cmake/BUILD.bazel
index c897b8f..b2a5e5a 100644
--- a/upb/cmake/BUILD.bazel
+++ b/upb/cmake/BUILD.bazel
@@ -6,12 +6,12 @@
 # https://developers.google.com/open-source/licenses/bsd
 
 load(
-    ":build_defs.bzl",
-    "staleness_test",
+    "//bazel:build_defs.bzl",
+    "make_shell_script",
 )
 load(
-    "//upb/bazel:build_defs.bzl",
-    "make_shell_script",
+    ":build_defs.bzl",
+    "staleness_test",
 )
 
 licenses(["notice"])
@@ -87,17 +87,17 @@
         ":copy_protos",
         ":gen_cmakelists",
         "//upb:source_files",
-        "//upb/upb/base:source_files",
-        "//upb/upb/collections:source_files",
-        "//upb/upb/hash:source_files",
-        "//upb/upb/lex:source_files",
-        "//upb/upb/mem:source_files",
-        "//upb/upb/message:source_files",
-        "//upb/upb/mini_descriptor:source_files",
-        "//upb/upb/mini_table:source_files",
-        "//upb/upb/port:source_files",
-        "//upb/upb/text:source_files",
-        "//upb/upb/wire:source_files",
+        "//upb/base:source_files",
+        "//upb/collections:source_files",
+        "//upb/hash:source_files",
+        "//upb/lex:source_files",
+        "//upb/mem:source_files",
+        "//upb/message:source_files",
+        "//upb/mini_descriptor:source_files",
+        "//upb/mini_table:source_files",
+        "//upb/port:source_files",
+        "//upb/text:source_files",
+        "//upb/wire:source_files",
         "@utf8_range//:utf8_range_srcs",
     ],
     target_compatible_with = select({
diff --git a/upb/upb/collections/BUILD b/upb/collections/BUILD
similarity index 95%
rename from upb/upb/collections/BUILD
rename to upb/collections/BUILD
index 66bb619..c043e68 100644
--- a/upb/upb/collections/BUILD
+++ b/upb/collections/BUILD
@@ -5,7 +5,7 @@
 # license that can be found in the LICENSE file or at
 # https://developers.google.com/open-source/licenses/bsd
 
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 
 cc_library(
     name = "collections",
@@ -73,9 +73,9 @@
     srcs = ["array_test.cc"],
     deps = [
         ":collections",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:mem",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -84,9 +84,9 @@
     srcs = ["map_test.cc"],
     deps = [
         ":collections",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:mem",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -101,7 +101,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/collections/array.c b/upb/collections/array.c
similarity index 98%
rename from upb/upb/collections/array.c
rename to upb/collections/array.c
index b51c586..f46fc3e 100644
--- a/upb/upb/collections/array.c
+++ b/upb/collections/array.c
@@ -28,12 +28,12 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upb/collections/internal/array.h"
+#include "upb/collections/internal/array.h"
 
 #include <string.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 const char _upb_Array_CTypeSizeLg2Table[] = {
     [kUpb_CType_Bool] = 0,
diff --git a/upb/upb/collections/array.h b/upb/collections/array.h
similarity index 94%
rename from upb/upb/collections/array.h
rename to upb/collections/array.h
index f74c9fa..6fb1e8f 100644
--- a/upb/upb/collections/array.h
+++ b/upb/collections/array.h
@@ -33,12 +33,12 @@
 
 #include <stddef.h>
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/value.h"  // IWYU pragma: export
+#include "upb/base/descriptor_constants.h"
+#include "upb/mem/arena.h"
+#include "upb/message/value.h"  // IWYU pragma: export
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct upb_Array upb_Array;
 
@@ -93,6 +93,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_COLLECTIONS_ARRAY_H_ */
diff --git a/upb/upb/collections/array_split64.h b/upb/collections/array_split64.h
similarity index 97%
rename from upb/upb/collections/array_split64.h
rename to upb/collections/array_split64.h
index 9afd40e..69ea579 100644
--- a/upb/upb/collections/array_split64.h
+++ b/upb/collections/array_split64.h
@@ -31,10 +31,10 @@
 #ifndef UPB_COLLECTIONS_ARRAY_SPLIT64_H_
 #define UPB_COLLECTIONS_ARRAY_SPLIT64_H_
 
-#include "upb/upb/collections/array.h"
+#include "upb/collections/array.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -88,6 +88,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_COLLECTIONS_ARRAY_SPLIT64_H_ */
diff --git a/upb/upb/collections/array_test.cc b/upb/collections/array_test.cc
similarity index 95%
rename from upb/upb/collections/array_test.cc
rename to upb/collections/array_test.cc
index 08fcfe7..fb1762e 100644
--- a/upb/upb/collections/array_test.cc
+++ b/upb/collections/array_test.cc
@@ -28,11 +28,11 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upb/collections/array.h"
+#include "upb/collections/array.h"
 
 #include <gtest/gtest.h>
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/mem/arena.hpp"
+#include "upb/base/status.hpp"
+#include "upb/mem/arena.hpp"
 
 TEST(ArrayTest, Resize) {
   upb::Arena arena;
diff --git a/upb/upb/collections/internal/array.h b/upb/collections/internal/array.h
similarity index 97%
rename from upb/upb/collections/internal/array.h
rename to upb/collections/internal/array.h
index 8d1d322..1c2f3f5 100644
--- a/upb/upb/collections/internal/array.h
+++ b/upb/collections/internal/array.h
@@ -33,10 +33,10 @@
 
 #include <string.h>
 
-#include "upb/upb/collections/array.h"
+#include "upb/collections/array.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -133,6 +133,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_COLLECTIONS_INTERNAL_ARRAY_H_ */
diff --git a/upb/upb/collections/internal/map.h b/upb/collections/internal/map.h
similarity index 96%
rename from upb/upb/collections/internal/map.h
rename to upb/collections/internal/map.h
index b32d448..b009254 100644
--- a/upb/upb/collections/internal/map.h
+++ b/upb/collections/internal/map.h
@@ -33,13 +33,13 @@
 #ifndef UPB_COLLECTIONS_INTERNAL_MAP_H_
 #define UPB_COLLECTIONS_INTERNAL_MAP_H_
 
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/hash/str_table.h"
-#include "upb/upb/mem/arena.h"
+#include "upb/base/string_view.h"
+#include "upb/collections/map.h"
+#include "upb/hash/str_table.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_Map {
   // Size of key and val, based on the map type.
@@ -168,6 +168,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_COLLECTIONS_INTERNAL_MAP_H_ */
diff --git a/upb/upb/collections/internal/map_entry.h b/upb/collections/internal/map_entry.h
similarity index 95%
rename from upb/upb/collections/internal/map_entry.h
rename to upb/collections/internal/map_entry.h
index 56bd44b..2718544 100644
--- a/upb/upb/collections/internal/map_entry.h
+++ b/upb/collections/internal/map_entry.h
@@ -31,9 +31,9 @@
 #ifndef UPB_COLLECTIONS_INTERNAL_MAP_ENTRY_H_
 #define UPB_COLLECTIONS_INTERNAL_MAP_ENTRY_H_
 
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/hash/common.h"
-#include "upb/upb/message/internal/types.h"
+#include "upb/base/string_view.h"
+#include "upb/hash/common.h"
+#include "upb/message/internal/types.h"
 
 // Map entries aren't actually stored for map fields, they are only used during
 // parsing. For parsing, it helps a lot if all map entry messages have the same
diff --git a/upb/upb/collections/internal/map_sorter.h b/upb/collections/internal/map_sorter.h
similarity index 94%
rename from upb/upb/collections/internal/map_sorter.h
rename to upb/collections/internal/map_sorter.h
index 4e1ff51..a464959 100644
--- a/upb/upb/collections/internal/map_sorter.h
+++ b/upb/collections/internal/map_sorter.h
@@ -35,12 +35,12 @@
 
 #include <stdlib.h>
 
-#include "upb/upb/collections/internal/map.h"
-#include "upb/upb/collections/internal/map_entry.h"
-#include "upb/upb/message/internal/extension.h"
+#include "upb/collections/internal/map.h"
+#include "upb/collections/internal/map_entry.h"
+#include "upb/message/internal/extension.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -107,6 +107,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_COLLECTIONS_INTERNAL_MAP_SORTER_H_ */
diff --git a/upb/upb/collections/map.c b/upb/collections/map.c
similarity index 96%
rename from upb/upb/collections/map.c
rename to upb/collections/map.c
index d6792eb..a445e59 100644
--- a/upb/upb/collections/map.c
+++ b/upb/collections/map.c
@@ -28,15 +28,15 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upb/collections/map.h"
+#include "upb/collections/map.h"
 
 #include <string.h>
 
-#include "upb/upb/collections/internal/map.h"
-#include "upb/upb/mem/arena.h"
+#include "upb/collections/internal/map.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // Strings/bytes are special-cased in maps.
 char _upb_Map_CTypeSizeTable[12] = {
diff --git a/upb/upb/collections/map.h b/upb/collections/map.h
similarity index 96%
rename from upb/upb/collections/map.h
rename to upb/collections/map.h
index e2b58cb..9377eac 100644
--- a/upb/upb/collections/map.h
+++ b/upb/collections/map.h
@@ -33,12 +33,12 @@
 
 #include <stddef.h>
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/value.h"  // IWYU pragma: export
+#include "upb/base/descriptor_constants.h"
+#include "upb/mem/arena.h"
+#include "upb/message/value.h"  // IWYU pragma: export
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct upb_Map upb_Map;
 
@@ -142,6 +142,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_COLLECTIONS_MAP_H_ */
diff --git a/upb/upb/collections/map_gencode_util.h b/upb/collections/map_gencode_util.h
similarity index 96%
rename from upb/upb/collections/map_gencode_util.h
rename to upb/collections/map_gencode_util.h
index 135ec62..c6df545 100644
--- a/upb/upb/collections/map_gencode_util.h
+++ b/upb/collections/map_gencode_util.h
@@ -33,10 +33,10 @@
 #ifndef UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_
 #define UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_
 
-#include "upb/upb/collections/internal/map.h"
+#include "upb/collections/internal/map.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -76,6 +76,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_ */
diff --git a/upb/upb/collections/map_sorter.c b/upb/collections/map_sorter.c
similarity index 97%
rename from upb/upb/collections/map_sorter.c
rename to upb/collections/map_sorter.c
index 8725cd6..9ad2a66 100644
--- a/upb/upb/collections/map_sorter.c
+++ b/upb/collections/map_sorter.c
@@ -28,12 +28,12 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upb/collections/internal/map_sorter.h"
+#include "upb/collections/internal/map_sorter.h"
 
-#include "upb/upb/base/internal/log2.h"
+#include "upb/base/internal/log2.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 static void _upb_mapsorter_getkeys(const void* _a, const void* _b, void* a_key,
                                    void* b_key, size_t size) {
diff --git a/upb/upb/collections/map_test.cc b/upb/collections/map_test.cc
similarity index 95%
rename from upb/upb/collections/map_test.cc
rename to upb/collections/map_test.cc
index 1a30456..0a24000 100644
--- a/upb/upb/collections/map_test.cc
+++ b/upb/collections/map_test.cc
@@ -28,11 +28,11 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upb/collections/map.h"
+#include "upb/collections/map.h"
 
 #include <gtest/gtest.h>
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/mem/arena.hpp"
+#include "upb/base/string_view.h"
+#include "upb/mem/arena.hpp"
 
 TEST(MapTest, DeleteRegression) {
   upb::Arena arena;
diff --git a/upb/upb/conformance/BUILD b/upb/conformance/BUILD
similarity index 98%
rename from upb/upb/conformance/BUILD
rename to upb/conformance/BUILD
index a8b63ab..c22ea41 100644
--- a/upb/upb/conformance/BUILD
+++ b/upb/conformance/BUILD
@@ -6,12 +6,12 @@
 # https://developers.google.com/open-source/licenses/bsd
 
 load(
-    "//upb/bazel:build_defs.bzl",
+    "//bazel:build_defs.bzl",
     "UPB_DEFAULT_COPTS",
     "make_shell_script",
 )
 load(
-    "//upb/bazel:upb_proto_library.bzl",
+    "//bazel:upb_proto_library.bzl",
     "upb_proto_library",
     "upb_proto_reflection_library",
 )
diff --git a/upb/upb/conformance/conformance_upb.c b/upb/conformance/conformance_upb.c
similarity index 97%
rename from upb/upb/conformance/conformance_upb.c
rename to upb/conformance/conformance_upb.c
index 4710405..a91224b 100644
--- a/upb/upb/conformance/conformance_upb.c
+++ b/upb/conformance/conformance_upb.c
@@ -18,15 +18,15 @@
 #include "conformance/conformance.upbdefs.h"
 #include "google/protobuf/test_messages_proto2.upbdefs.h"
 #include "google/protobuf/test_messages_proto3.upbdefs.h"
-#include "upb/upb/json/decode.h"
-#include "upb/upb/json/encode.h"
-#include "upb/upb/reflection/message.h"
-#include "upb/upb/text/encode.h"
-#include "upb/upb/wire/decode.h"
-#include "upb/upb/wire/encode.h"
+#include "upb/json/decode.h"
+#include "upb/json/encode.h"
+#include "upb/reflection/message.h"
+#include "upb/text/encode.h"
+#include "upb/wire/decode.h"
+#include "upb/wire/encode.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 int test_count = 0;
 bool verbose = false; /* Set to true to get req/resp printed on stderr. */
diff --git a/upb/upb/conformance/conformance_upb_failures.txt b/upb/conformance/conformance_upb_failures.txt
similarity index 100%
rename from upb/upb/conformance/conformance_upb_failures.txt
rename to upb/conformance/conformance_upb_failures.txt
diff --git a/upb/generated_code_support.h b/upb/generated_code_support.h
new file mode 100644
index 0000000..9f222cc
--- /dev/null
+++ b/upb/generated_code_support.h
@@ -0,0 +1,33 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2023 Google LLC.  All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file or at
+// https://developers.google.com/open-source/licenses/bsd
+
+#ifndef UPB_GENERATED_CODE_SUPPORT_H_
+#define UPB_GENERATED_CODE_SUPPORT_H_
+
+// IWYU pragma: begin_exports
+#include "upb/collections/array.h"
+#include "upb/collections/internal/array.h"
+#include "upb/collections/map_gencode_util.h"
+#include "upb/message/accessors.h"
+#include "upb/message/internal/accessors.h"
+#include "upb/message/internal/extension.h"
+#include "upb/message/internal/message.h"
+#include "upb/message/message.h"
+#include "upb/mini_descriptor/decode.h"
+#include "upb/mini_table/enum.h"
+#include "upb/mini_table/extension.h"
+#include "upb/mini_table/extension_registry.h"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/file.h"
+#include "upb/mini_table/message.h"
+#include "upb/mini_table/sub.h"
+#include "upb/wire/decode.h"
+#include "upb/wire/decode_fast.h"
+#include "upb/wire/encode.h"
+// IWYU pragma: end_exports
+
+#endif  // UPB_GENERATED_CODE_SUPPORT_H_
diff --git a/upb/upb/hash/BUILD b/upb/hash/BUILD
similarity index 91%
rename from upb/upb/hash/BUILD
rename to upb/hash/BUILD
index a83ee68..4c18e0c 100644
--- a/upb/upb/hash/BUILD
+++ b/upb/hash/BUILD
@@ -5,7 +5,7 @@
 # license that can be found in the LICENSE file or at
 # https://developers.google.com/open-source/licenses/bsd
 
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 
 cc_library(
     name = "hash",
@@ -32,10 +32,10 @@
     srcs = ["test.cc"],
     deps = [
         ":hash",
+        "@com_google_googletest//:gtest_main",
         "//upb:mem",
         "//upb:port",
         "@com_google_absl//absl/container:flat_hash_map",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -50,7 +50,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/hash/common.c b/upb/hash/common.c
similarity index 99%
rename from upb/upb/hash/common.c
rename to upb/hash/common.c
index f0622fb..f8bb7fc 100644
--- a/upb/upb/hash/common.c
+++ b/upb/hash/common.c
@@ -13,12 +13,12 @@
 
 #include <string.h>
 
-#include "upb/upb/base/internal/log2.h"
-#include "upb/upb/hash/int_table.h"
-#include "upb/upb/hash/str_table.h"
+#include "upb/base/internal/log2.h"
+#include "upb/hash/int_table.h"
+#include "upb/hash/str_table.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #define UPB_MAXARRSIZE 16  // 2**16 = 64k.
 
diff --git a/upb/upb/hash/common.h b/upb/hash/common.h
similarity index 97%
rename from upb/upb/hash/common.h
rename to upb/hash/common.h
index c972f3e..889d375 100644
--- a/upb/upb/hash/common.h
+++ b/upb/hash/common.h
@@ -29,11 +29,11 @@
 
 #include <string.h>
 
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/mem/arena.h"
+#include "upb/base/string_view.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -169,6 +169,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_HASH_COMMON_H_ */
diff --git a/upb/upb/hash/int_table.h b/upb/hash/int_table.h
similarity index 96%
rename from upb/upb/hash/int_table.h
rename to upb/hash/int_table.h
index 3986d64..f7a41ea 100644
--- a/upb/upb/hash/int_table.h
+++ b/upb/hash/int_table.h
@@ -8,10 +8,10 @@
 #ifndef UPB_HASH_INT_TABLE_H_
 #define UPB_HASH_INT_TABLE_H_
 
-#include "upb/upb/hash/common.h"
+#include "upb/hash/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct {
   upb_table t;              // For entries that don't fit in the array part.
@@ -77,6 +77,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_HASH_INT_TABLE_H_ */
diff --git a/upb/upb/hash/str_table.h b/upb/hash/str_table.h
similarity index 97%
rename from upb/upb/hash/str_table.h
rename to upb/hash/str_table.h
index 5ead445..c90c1e9 100644
--- a/upb/upb/hash/str_table.h
+++ b/upb/hash/str_table.h
@@ -8,10 +8,10 @@
 #ifndef UPB_HASH_STR_TABLE_H_
 #define UPB_HASH_STR_TABLE_H_
 
-#include "upb/upb/hash/common.h"
+#include "upb/hash/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct {
   upb_table t;
@@ -137,6 +137,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_HASH_STR_TABLE_H_ */
diff --git a/upb/upb/hash/test.cc b/upb/hash/test.cc
similarity index 97%
rename from upb/upb/hash/test.cc
rename to upb/hash/test.cc
index f0dcbee..e85940b 100644
--- a/upb/upb/hash/test.cc
+++ b/upb/hash/test.cc
@@ -18,12 +18,12 @@
 
 #include <gtest/gtest.h>
 #include "absl/container/flat_hash_map.h"
-#include "upb/upb/hash/int_table.h"
-#include "upb/upb/hash/str_table.h"
-#include "upb/upb/mem/arena.hpp"
+#include "upb/hash/int_table.h"
+#include "upb/hash/str_table.h"
+#include "upb/mem/arena.hpp"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 using std::vector;
 
diff --git a/upb/upb/io/BUILD b/upb/io/BUILD
similarity index 99%
rename from upb/upb/io/BUILD
rename to upb/io/BUILD
index 9874948..3164864 100644
--- a/upb/upb/io/BUILD
+++ b/upb/io/BUILD
@@ -64,8 +64,8 @@
     srcs = ["string_test.cc"],
     deps = [
         ":string",
-        "//upb:mem",
         "@com_google_googletest//:gtest_main",
+        "//upb:mem",
     ],
 )
 
@@ -78,12 +78,12 @@
         ":string",
         ":tokenizer",
         ":zero_copy_stream",
+        "@com_google_googletest//:gtest_main",
+        "@com_google_absl//absl/strings",
+        "@com_google_absl//absl/strings:str_format",
         "//upb:lex",
         "//upb:mem",
         "//upb:port",
-        "@com_google_absl//absl/strings",
-        "@com_google_absl//absl/strings:str_format",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -96,8 +96,8 @@
     deps = [
         ":chunked_stream",
         ":zero_copy_stream",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:mem",
-        "@com_google_googletest//:gtest_main",
     ],
 )
diff --git a/upb/upb/io/README.md b/upb/io/README.md
similarity index 100%
rename from upb/upb/io/README.md
rename to upb/io/README.md
diff --git a/upb/upb/io/chunked_input_stream.c b/upb/io/chunked_input_stream.c
similarity index 96%
rename from upb/upb/io/chunked_input_stream.c
rename to upb/io/chunked_input_stream.c
index 5a3af24..0493cf5 100644
--- a/upb/upb/io/chunked_input_stream.c
+++ b/upb/io/chunked_input_stream.c
@@ -5,10 +5,10 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/io/chunked_input_stream.h"
+#include "upb/io/chunked_input_stream.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct {
   upb_ZeroCopyInputStream base;
diff --git a/upb/upb/io/chunked_input_stream.h b/upb/io/chunked_input_stream.h
similarity index 85%
rename from upb/upb/io/chunked_input_stream.h
rename to upb/io/chunked_input_stream.h
index 610f1fb..e872075 100644
--- a/upb/upb/io/chunked_input_stream.h
+++ b/upb/io/chunked_input_stream.h
@@ -8,11 +8,11 @@
 #ifndef UPB_IO_CHUNKED_INPUT_STREAM_H_
 #define UPB_IO_CHUNKED_INPUT_STREAM_H_
 
-#include "upb/upb/io/zero_copy_input_stream.h"
-#include "upb/upb/mem/arena.h"
+#include "upb/io/zero_copy_input_stream.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -28,6 +28,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_IO_CHUNKED_INPUT_STREAM_H_ */
diff --git a/upb/upb/io/chunked_output_stream.c b/upb/io/chunked_output_stream.c
similarity index 96%
rename from upb/upb/io/chunked_output_stream.c
rename to upb/io/chunked_output_stream.c
index 0a2891d..a960fbf 100644
--- a/upb/upb/io/chunked_output_stream.c
+++ b/upb/io/chunked_output_stream.c
@@ -5,10 +5,10 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/io/chunked_output_stream.h"
+#include "upb/io/chunked_output_stream.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct {
   upb_ZeroCopyOutputStream base;
diff --git a/upb/upb/io/chunked_output_stream.h b/upb/io/chunked_output_stream.h
similarity index 85%
rename from upb/upb/io/chunked_output_stream.h
rename to upb/io/chunked_output_stream.h
index d3af9fe..2e1e31f 100644
--- a/upb/upb/io/chunked_output_stream.h
+++ b/upb/io/chunked_output_stream.h
@@ -8,11 +8,11 @@
 #ifndef UPB_IO_CHUNKED_OUTPUT_STREAM_H_
 #define UPB_IO_CHUNKED_OUTPUT_STREAM_H_
 
-#include "upb/upb/io/zero_copy_output_stream.h"
-#include "upb/upb/mem/arena.h"
+#include "upb/io/zero_copy_output_stream.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -28,6 +28,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_IO_CHUNKED_OUTPUT_STREAM_H_ */
diff --git a/upb/upb/io/string.h b/upb/io/string.h
similarity index 96%
rename from upb/upb/io/string.h
rename to upb/io/string.h
index a56f25b..ffaffb0 100644
--- a/upb/upb/io/string.h
+++ b/upb/io/string.h
@@ -18,11 +18,11 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/port/vsnprintf_compat.h"
+#include "upb/mem/arena.h"
+#include "upb/port/vsnprintf_compat.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -142,6 +142,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_IO_STRING_H_ */
diff --git a/upb/upb/io/string_test.cc b/upb/io/string_test.cc
similarity index 97%
rename from upb/upb/io/string_test.cc
rename to upb/io/string_test.cc
index 36f48c6..dcdaa4d 100644
--- a/upb/upb/io/string_test.cc
+++ b/upb/io/string_test.cc
@@ -5,12 +5,12 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/io/string.h"
+#include "upb/io/string.h"
 
 #include <string.h>
 
 #include <gtest/gtest.h>
-#include "upb/upb/mem/arena.hpp"
+#include "upb/mem/arena.hpp"
 
 TEST(StringTest, Append) {
   upb::Arena arena;
diff --git a/upb/upb/io/tokenizer.c b/upb/io/tokenizer.c
similarity index 99%
rename from upb/upb/io/tokenizer.c
rename to upb/io/tokenizer.c
index 2eafda0..cfc1d40 100644
--- a/upb/upb/io/tokenizer.c
+++ b/upb/io/tokenizer.c
@@ -5,14 +5,14 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/io/tokenizer.h"
+#include "upb/io/tokenizer.h"
 
-#include "upb/upb/io/string.h"
-#include "upb/upb/lex/strtod.h"
-#include "upb/upb/lex/unicode.h"
+#include "upb/io/string.h"
+#include "upb/lex/strtod.h"
+#include "upb/lex/unicode.h"
 
 // Must be included last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef enum {
   // Started a line comment.
diff --git a/upb/upb/io/tokenizer.h b/upb/io/tokenizer.h
similarity index 95%
rename from upb/upb/io/tokenizer.h
rename to upb/io/tokenizer.h
index 993c204..3ef7f30 100644
--- a/upb/upb/io/tokenizer.h
+++ b/upb/io/tokenizer.h
@@ -10,13 +10,13 @@
 #ifndef UPB_IO_TOKENIZER_H_
 #define UPB_IO_TOKENIZER_H_
 
-#include "upb/upb/base/status.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/io/zero_copy_input_stream.h"
-#include "upb/upb/mem/arena.h"
+#include "upb/base/status.h"
+#include "upb/base/string_view.h"
+#include "upb/io/zero_copy_input_stream.h"
+#include "upb/mem/arena.h"
 
 // Must be included last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -128,6 +128,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_IO_TOKENIZER_H_
diff --git a/upb/upb/io/tokenizer_test.cc b/upb/io/tokenizer_test.cc
similarity index 99%
rename from upb/upb/io/tokenizer_test.cc
rename to upb/io/tokenizer_test.cc
index e7c24f7..70027d3 100644
--- a/upb/upb/io/tokenizer_test.cc
+++ b/upb/io/tokenizer_test.cc
@@ -5,18 +5,18 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/io/tokenizer.h"
+#include "upb/io/tokenizer.h"
 
 #include <gtest/gtest.h>
 #include "absl/strings/escaping.h"
 #include "absl/strings/str_format.h"
-#include "upb/upb/io/chunked_input_stream.h"
-#include "upb/upb/io/string.h"
-#include "upb/upb/lex/unicode.h"
-#include "upb/upb/mem/arena.hpp"
+#include "upb/io/chunked_input_stream.h"
+#include "upb/io/string.h"
+#include "upb/lex/unicode.h"
+#include "upb/mem/arena.hpp"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace google {
 namespace protobuf {
diff --git a/upb/upb/io/zero_copy_input_stream.h b/upb/io/zero_copy_input_stream.h
similarity index 97%
rename from upb/upb/io/zero_copy_input_stream.h
rename to upb/io/zero_copy_input_stream.h
index e8bd380..e5b05ec 100644
--- a/upb/upb/io/zero_copy_input_stream.h
+++ b/upb/io/zero_copy_input_stream.h
@@ -8,10 +8,10 @@
 #ifndef UPB_IO_ZERO_COPY_INPUT_STREAM_H_
 #define UPB_IO_ZERO_COPY_INPUT_STREAM_H_
 
-#include "upb/upb/base/status.h"
+#include "upb/base/status.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -104,6 +104,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_IO_ZERO_COPY_INPUT_STREAM_H_ */
diff --git a/upb/upb/io/zero_copy_output_stream.h b/upb/io/zero_copy_output_stream.h
similarity index 97%
rename from upb/upb/io/zero_copy_output_stream.h
rename to upb/io/zero_copy_output_stream.h
index e63855c..dae386a 100644
--- a/upb/upb/io/zero_copy_output_stream.h
+++ b/upb/io/zero_copy_output_stream.h
@@ -8,10 +8,10 @@
 #ifndef UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_
 #define UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_
 
-#include "upb/upb/base/status.h"
+#include "upb/base/status.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -105,6 +105,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_ */
diff --git a/upb/upb/io/zero_copy_stream_test.cc b/upb/io/zero_copy_stream_test.cc
similarity index 98%
rename from upb/upb/io/zero_copy_stream_test.cc
rename to upb/io/zero_copy_stream_test.cc
index 991e7dd..392d924 100644
--- a/upb/upb/io/zero_copy_stream_test.cc
+++ b/upb/io/zero_copy_stream_test.cc
@@ -15,10 +15,10 @@
 // the output.
 
 #include <gtest/gtest.h>
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/io/chunked_input_stream.h"
-#include "upb/upb/io/chunked_output_stream.h"
-#include "upb/upb/mem/arena.hpp"
+#include "upb/base/status.hpp"
+#include "upb/io/chunked_input_stream.h"
+#include "upb/io/chunked_output_stream.h"
+#include "upb/mem/arena.hpp"
 
 namespace upb {
 namespace {
diff --git a/upb/upb/json/BUILD b/upb/json/BUILD
similarity index 94%
rename from upb/upb/json/BUILD
rename to upb/json/BUILD
index 2a75d35..fc09d39 100644
--- a/upb/upb/json/BUILD
+++ b/upb/json/BUILD
@@ -1,8 +1,8 @@
 # TODO: describe this package.
 
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 load(
-    "//upb/bazel:upb_proto_library.bzl",
+    "//bazel:upb_proto_library.bzl",
     "upb_proto_library",
     "upb_proto_reflection_library",
 )
@@ -36,9 +36,9 @@
         ":struct_upb_proto",
         ":test_upb_proto",
         ":test_upb_proto_reflection",
+        "@com_google_googletest//:gtest_main",
         "//upb:mem",
         "//upb:reflection",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -50,10 +50,10 @@
         ":struct_upb_proto",
         ":test_upb_proto",
         ":test_upb_proto_reflection",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:mem",
         "//upb:reflection",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
diff --git a/upb/upb/json/decode.c b/upb/json/decode.c
similarity index 99%
rename from upb/upb/json/decode.c
rename to upb/json/decode.c
index 06fd267..0f4346b 100644
--- a/upb/upb/json/decode.c
+++ b/upb/json/decode.c
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upb/json/decode.h"
+#include "upb/json/decode.h"
 
 #include <errno.h>
 #include <float.h>
@@ -38,14 +38,14 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "upb/upb/collections/map.h"
-#include "upb/upb/lex/atoi.h"
-#include "upb/upb/lex/unicode.h"
-#include "upb/upb/reflection/message.h"
-#include "upb/upb/wire/encode.h"
+#include "upb/collections/map.h"
+#include "upb/lex/atoi.h"
+#include "upb/lex/unicode.h"
+#include "upb/reflection/message.h"
+#include "upb/wire/encode.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct {
   const char *ptr, *end;
diff --git a/upb/upb/json/decode.h b/upb/json/decode.h
similarity index 95%
rename from upb/upb/json/decode.h
rename to upb/json/decode.h
index 52882a9..8f58797 100644
--- a/upb/upb/json/decode.h
+++ b/upb/json/decode.h
@@ -31,10 +31,10 @@
 #ifndef UPB_JSON_DECODE_H_
 #define UPB_JSON_DECODE_H_
 
-#include "upb/upb/reflection/def.h"
+#include "upb/reflection/def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -50,6 +50,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_JSONDECODE_H_ */
diff --git a/upb/upb/json/decode_test.cc b/upb/json/decode_test.cc
similarity index 94%
rename from upb/upb/json/decode_test.cc
rename to upb/json/decode_test.cc
index 1f4df2d..75fa9be 100644
--- a/upb/upb/json/decode_test.cc
+++ b/upb/json/decode_test.cc
@@ -28,14 +28,14 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upb/json/decode.h"
+#include "upb/json/decode.h"
 
 #include "google/protobuf/struct.upb.h"
 #include <gtest/gtest.h>
-#include "upb/upb/json/test.upb.h"
-#include "upb/upb/json/test.upbdefs.h"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/reflection/def.hpp"
+#include "upb/json/test.upb.h"
+#include "upb/json/test.upbdefs.h"
+#include "upb/mem/arena.hpp"
+#include "upb/reflection/def.hpp"
 
 static upb_test_Box* JsonDecode(const char* json, upb_Arena* a) {
   upb::Status status;
diff --git a/upb/upb/json/encode.c b/upb/json/encode.c
similarity index 98%
rename from upb/upb/json/encode.c
rename to upb/json/encode.c
index b103a64..656bee9 100644
--- a/upb/upb/json/encode.c
+++ b/upb/json/encode.c
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upb/json/encode.h"
+#include "upb/json/encode.h"
 
 #include <ctype.h>
 #include <float.h>
@@ -37,14 +37,14 @@
 #include <stdarg.h>
 #include <string.h>
 
-#include "upb/upb/collections/map.h"
-#include "upb/upb/lex/round_trip.h"
-#include "upb/upb/port/vsnprintf_compat.h"
-#include "upb/upb/reflection/message.h"
-#include "upb/upb/wire/decode.h"
+#include "upb/collections/map.h"
+#include "upb/lex/round_trip.h"
+#include "upb/port/vsnprintf_compat.h"
+#include "upb/reflection/message.h"
+#include "upb/wire/decode.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct {
   char *buf, *ptr, *end;
diff --git a/upb/upb/json/encode.h b/upb/json/encode.h
similarity index 96%
rename from upb/upb/json/encode.h
rename to upb/json/encode.h
index 34c1551..ec8b25b 100644
--- a/upb/upb/json/encode.h
+++ b/upb/json/encode.h
@@ -31,10 +31,10 @@
 #ifndef UPB_JSON_ENCODE_H_
 #define UPB_JSON_ENCODE_H_
 
-#include "upb/upb/reflection/def.h"
+#include "upb/reflection/def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -68,6 +68,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_JSONENCODE_H_ */
diff --git a/upb/upb/json/encode_test.cc b/upb/json/encode_test.cc
similarity index 94%
rename from upb/upb/json/encode_test.cc
rename to upb/json/encode_test.cc
index c7c48b2..67adcc0 100644
--- a/upb/upb/json/encode_test.cc
+++ b/upb/json/encode_test.cc
@@ -28,15 +28,15 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upb/json/encode.h"
+#include "upb/json/encode.h"
 
 #include "google/protobuf/struct.upb.h"
 #include <gtest/gtest.h>
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/json/test.upb.h"
-#include "upb/upb/json/test.upbdefs.h"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/reflection/def.hpp"
+#include "upb/base/status.hpp"
+#include "upb/json/test.upb.h"
+#include "upb/json/test.upbdefs.h"
+#include "upb/mem/arena.hpp"
+#include "upb/reflection/def.hpp"
 
 static std::string JsonEncode(const upb_test_Box* msg, int options) {
   upb::Arena a;
diff --git a/upb/upb/json/test.proto b/upb/json/test.proto
similarity index 100%
rename from upb/upb/json/test.proto
rename to upb/json/test.proto
diff --git a/upb/upb/lex/BUILD b/upb/lex/BUILD
similarity index 91%
rename from upb/upb/lex/BUILD
rename to upb/lex/BUILD
index c40c362..664074b 100644
--- a/upb/upb/lex/BUILD
+++ b/upb/lex/BUILD
@@ -5,7 +5,7 @@
 # license that can be found in the LICENSE file or at
 # https://developers.google.com/open-source/licenses/bsd
 
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 
 cc_library(
     name = "lex",
@@ -31,8 +31,8 @@
     srcs = ["atoi_test.cc"],
     deps = [
         ":lex",
-        "@com_google_absl//absl/strings",
         "@com_google_googletest//:gtest_main",
+        "@com_google_absl//absl/strings",
     ],
 )
 
@@ -47,7 +47,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/lex/atoi.c b/upb/lex/atoi.c
similarity index 94%
rename from upb/upb/lex/atoi.c
rename to upb/lex/atoi.c
index 76312fc..720aacf 100644
--- a/upb/upb/lex/atoi.c
+++ b/upb/lex/atoi.c
@@ -5,10 +5,10 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/lex/atoi.h"
+#include "upb/lex/atoi.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 const char* upb_BufToUint64(const char* ptr, const char* end, uint64_t* val) {
   uint64_t u64 = 0;
diff --git a/upb/upb/lex/atoi.h b/upb/lex/atoi.h
similarity index 93%
rename from upb/upb/lex/atoi.h
rename to upb/lex/atoi.h
index 8d9c601..6d57fa0 100644
--- a/upb/upb/lex/atoi.h
+++ b/upb/lex/atoi.h
@@ -11,7 +11,7 @@
 #include <stdint.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -30,6 +30,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_LEX_ATOI_H_ */
diff --git a/upb/upb/lex/atoi_test.cc b/upb/lex/atoi_test.cc
similarity index 98%
rename from upb/upb/lex/atoi_test.cc
rename to upb/lex/atoi_test.cc
index c0608d8..bf5547a 100644
--- a/upb/upb/lex/atoi_test.cc
+++ b/upb/lex/atoi_test.cc
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/lex/atoi.h"
+#include "upb/lex/atoi.h"
 
 #include <gtest/gtest.h>
 #include "absl/strings/str_cat.h"
diff --git a/upb/upb/lex/round_trip.c b/upb/lex/round_trip.c
similarity index 95%
rename from upb/upb/lex/round_trip.c
rename to upb/lex/round_trip.c
index 4341af6..1310434 100644
--- a/upb/upb/lex/round_trip.c
+++ b/upb/lex/round_trip.c
@@ -5,13 +5,13 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/lex/round_trip.h"
+#include "upb/lex/round_trip.h"
 
 #include <float.h>
 #include <stdlib.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 /* Miscellaneous utilities ****************************************************/
 
diff --git a/upb/upb/lex/round_trip.h b/upb/lex/round_trip.h
similarity index 93%
rename from upb/upb/lex/round_trip.h
rename to upb/lex/round_trip.h
index f50a9c7..0306c44 100644
--- a/upb/upb/lex/round_trip.h
+++ b/upb/lex/round_trip.h
@@ -9,7 +9,7 @@
 #define UPB_LEX_ROUND_TRIP_H_
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // Encodes a float or double that is round-trippable, but as short as possible.
 // These routines are not fully optimal (not guaranteed to be shortest), but are
@@ -30,6 +30,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_LEX_ROUND_TRIP_H_ */
diff --git a/upb/upb/lex/strtod.c b/upb/lex/strtod.c
similarity index 97%
rename from upb/upb/lex/strtod.c
rename to upb/lex/strtod.c
index f2cb22c..d59e369 100644
--- a/upb/upb/lex/strtod.c
+++ b/upb/lex/strtod.c
@@ -5,13 +5,13 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/lex/strtod.h"
+#include "upb/lex/strtod.h"
 
 #include <stdlib.h>
 #include <string.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // Determine the locale-specific radix character by calling sprintf() to print
 // the number 1.5, then stripping off the digits.  As far as I can tell, this
diff --git a/upb/upb/lex/strtod.h b/upb/lex/strtod.h
similarity index 88%
rename from upb/upb/lex/strtod.h
rename to upb/lex/strtod.h
index 09a49e4..86b18db 100644
--- a/upb/upb/lex/strtod.h
+++ b/upb/lex/strtod.h
@@ -9,7 +9,7 @@
 #define UPB_LEX_STRTOD_H_
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -21,6 +21,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_LEX_STRTOD_H_ */
diff --git a/upb/upb/lex/unicode.c b/upb/lex/unicode.c
similarity index 92%
rename from upb/upb/lex/unicode.c
rename to upb/lex/unicode.c
index 5d7404f..53121e9 100644
--- a/upb/upb/lex/unicode.c
+++ b/upb/lex/unicode.c
@@ -5,10 +5,10 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/lex/unicode.h"
+#include "upb/lex/unicode.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 int upb_Unicode_ToUTF8(uint32_t cp, char* out) {
   if (cp <= 0x7f) {
diff --git a/upb/upb/lex/unicode.h b/upb/lex/unicode.h
similarity index 95%
rename from upb/upb/lex/unicode.h
rename to upb/lex/unicode.h
index 76ae481..9b8a405 100644
--- a/upb/upb/lex/unicode.h
+++ b/upb/lex/unicode.h
@@ -11,7 +11,7 @@
 #include <stdint.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -54,6 +54,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_LEX_UNICODE_H_ */
diff --git a/upb/upb/mem/BUILD b/upb/mem/BUILD
similarity index 93%
rename from upb/upb/mem/BUILD
rename to upb/mem/BUILD
index 0584e6c..71e007e 100644
--- a/upb/upb/mem/BUILD
+++ b/upb/mem/BUILD
@@ -5,7 +5,7 @@
 # license that can be found in the LICENSE file or at
 # https://developers.google.com/open-source/licenses/bsd
 
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 
 cc_library(
     name = "mem",
@@ -44,12 +44,12 @@
     name = "arena_test",
     srcs = ["arena_test.cc"],
     deps = [
+        "@com_google_googletest//:gtest_main",
         "//upb:mem",
         "//upb:port",
         "@com_google_absl//absl/random",
         "@com_google_absl//absl/random:distributions",
         "@com_google_absl//absl/synchronization",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -65,7 +65,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/mem/alloc.c b/upb/mem/alloc.c
similarity index 90%
rename from upb/upb/mem/alloc.c
rename to upb/mem/alloc.c
index 4e5f9f6..d103f98 100644
--- a/upb/upb/mem/alloc.c
+++ b/upb/mem/alloc.c
@@ -5,12 +5,12 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mem/alloc.h"
+#include "upb/mem/alloc.h"
 
 #include <stdlib.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 static void* upb_global_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize,
                                   size_t size) {
diff --git a/upb/upb/mem/alloc.h b/upb/mem/alloc.h
similarity index 96%
rename from upb/upb/mem/alloc.h
rename to upb/mem/alloc.h
index ed6ec48..441731d 100644
--- a/upb/upb/mem/alloc.h
+++ b/upb/mem/alloc.h
@@ -9,7 +9,7 @@
 #define UPB_MEM_ALLOC_H_
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -73,6 +73,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MEM_ALLOC_H_ */
diff --git a/upb/upb/mem/arena.c b/upb/mem/arena.c
similarity index 98%
rename from upb/upb/mem/arena.c
rename to upb/mem/arena.c
index e72a86c..7e34f86 100644
--- a/upb/upb/mem/arena.c
+++ b/upb/mem/arena.c
@@ -5,12 +5,12 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mem/internal/arena.h"
+#include "upb/mem/internal/arena.h"
 
-#include "upb/upb/port/atomic.h"
+#include "upb/port/atomic.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct _upb_MemBlock {
   // Atomic only for the benefit of SpaceAllocated().
diff --git a/upb/upb/mem/arena.h b/upb/mem/arena.h
similarity index 97%
rename from upb/upb/mem/arena.h
rename to upb/mem/arena.h
index 3e4451a..e7fd852 100644
--- a/upb/upb/mem/arena.h
+++ b/upb/mem/arena.h
@@ -24,10 +24,10 @@
 #include <stdint.h>
 #include <string.h>
 
-#include "upb/upb/mem/alloc.h"
+#include "upb/mem/alloc.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct upb_Arena upb_Arena;
 
@@ -124,6 +124,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MEM_ARENA_H_ */
diff --git a/upb/upb/mem/arena.hpp b/upb/mem/arena.hpp
similarity index 97%
rename from upb/upb/mem/arena.hpp
rename to upb/mem/arena.hpp
index 2520b42..4a0bc33 100644
--- a/upb/upb/mem/arena.hpp
+++ b/upb/mem/arena.hpp
@@ -10,7 +10,7 @@
 
 #include <memory>
 
-#include "upb/upb/mem/arena.h"
+#include "upb/mem/arena.h"
 
 namespace upb {
 
diff --git a/upb/upb/mem/arena_test.cc b/upb/mem/arena_test.cc
similarity index 98%
rename from upb/upb/mem/arena_test.cc
rename to upb/mem/arena_test.cc
index 392c7be..7020da1 100644
--- a/upb/upb/mem/arena_test.cc
+++ b/upb/mem/arena_test.cc
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mem/arena.h"
+#include "upb/mem/arena.h"
 
 #include <array>
 #include <atomic>
@@ -19,7 +19,7 @@
 #include "absl/synchronization/notification.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace {
 
diff --git a/upb/upb/mem/internal/arena.h b/upb/mem/internal/arena.h
similarity index 96%
rename from upb/upb/mem/internal/arena.h
rename to upb/mem/internal/arena.h
index 9ceb026..21741c5 100644
--- a/upb/upb/mem/internal/arena.h
+++ b/upb/mem/internal/arena.h
@@ -8,10 +8,10 @@
 #ifndef UPB_MEM_INTERNAL_ARENA_H_
 #define UPB_MEM_INTERNAL_ARENA_H_
 
-#include "upb/upb/mem/arena.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct _upb_MemBlock _upb_MemBlock;
 
@@ -89,6 +89,6 @@
   return arena->block_alloc & 0x1;
 }
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MEM_INTERNAL_ARENA_H_ */
diff --git a/upb/upb/message/BUILD b/upb/message/BUILD
similarity index 90%
rename from upb/upb/message/BUILD
rename to upb/message/BUILD
index 1ec9d95..78b9c03 100644
--- a/upb/upb/message/BUILD
+++ b/upb/message/BUILD
@@ -5,9 +5,9 @@
 # license that can be found in the LICENSE file or at
 # https://developers.google.com/open-source/licenses/bsd
 
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 load(
-    "//upb/bazel:upb_proto_library.bzl",
+    "//bazel:upb_proto_library.bzl",
     "upb_proto_library",
     "upb_proto_reflection_library",
 )
@@ -232,6 +232,7 @@
     deps = [
         ":accessors",
         "//:protobuf",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:collections",
         "//upb:mini_descriptor",
@@ -239,11 +240,10 @@
         "//upb:mini_table",
         "//upb:port",
         "//upb:wire",
-        "//upb/upb/test:test_messages_proto2_upb_proto",
-        "//upb/upb/test:test_messages_proto3_upb_proto",
-        "//upb/upb/test:test_upb_proto",
+        "//upb/test:test_messages_proto2_upb_proto",
+        "//upb/test:test_messages_proto3_upb_proto",
+        "//upb/test:test_upb_proto",
         "@com_google_absl//absl/container:flat_hash_set",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -256,16 +256,16 @@
         ":internal",
         ":message",
         "//:protobuf",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:collections",
         "//upb:mem",
         "//upb:mini_table",
         "//upb:wire",
-        "//upb/upb/test:test_messages_proto2_upb_proto",
-        "//upb/upb/test:test_messages_proto3_upb_proto",
-        "//upb/upb/test:test_upb_proto",
+        "//upb/test:test_messages_proto2_upb_proto",
+        "//upb/test:test_messages_proto3_upb_proto",
+        "//upb/test:test_upb_proto",
         "@com_google_absl//absl/container:flat_hash_set",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -277,6 +277,7 @@
         ":copy",
         ":promote",
         "//:protobuf",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:collections",
         "//upb:mem",
@@ -284,11 +285,10 @@
         "//upb:mini_table",
         "//upb:port",
         "//upb:wire",
-        "//upb/upb/test:test_messages_proto2_upb_proto",
-        "//upb/upb/test:test_messages_proto3_upb_proto",
-        "//upb/upb/test:test_upb_proto",
+        "//upb/test:test_messages_proto2_upb_proto",
+        "//upb/test:test_messages_proto3_upb_proto",
+        "//upb/test:test_upb_proto",
         "@com_google_absl//absl/container:flat_hash_set",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -300,14 +300,14 @@
     deps = [
         ":message_test_upb_proto",
         ":message_test_upb_proto_reflection",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:json",
         "//upb:mem",
         "//upb:reflection",
         "//upb:wire",
-        "//upb/upb/test:fuzz_util",
-        "//upb/upb/test:test_messages_proto3_upb_proto",
-        "@com_google_googletest//:gtest_main",
+        "//upb/test:fuzz_util",
+        "//upb/test:test_messages_proto3_upb_proto",
     ],
 )
 
@@ -329,10 +329,10 @@
     srcs = ["utf8_test.cc"],
     deps = [
         ":utf8_test_upb_proto",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:mem",
         "//upb:wire",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -347,7 +347,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/message/accessors.c b/upb/message/accessors.c
similarity index 85%
rename from upb/upb/message/accessors.c
rename to upb/message/accessors.c
index 8d8c287..f3969a9 100644
--- a/upb/upb/message/accessors.c
+++ b/upb/message/accessors.c
@@ -5,20 +5,20 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/message/accessors.h"
+#include "upb/message/accessors.h"
 
-#include "upb/upb/collections/array.h"
-#include "upb/upb/collections/internal/array.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/wire/decode.h"
-#include "upb/upb/wire/encode.h"
-#include "upb/upb/wire/eps_copy_input_stream.h"
-#include "upb/upb/wire/reader.h"
+#include "upb/collections/array.h"
+#include "upb/collections/internal/array.h"
+#include "upb/collections/map.h"
+#include "upb/message/message.h"
+#include "upb/mini_table/field.h"
+#include "upb/wire/decode.h"
+#include "upb/wire/encode.h"
+#include "upb/wire/eps_copy_input_stream.h"
+#include "upb/wire/reader.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 upb_MapInsertStatus upb_Message_InsertMapEntry(upb_Map* map,
                                                const upb_MiniTable* mini_table,
diff --git a/upb/upb/message/accessors.h b/upb/message/accessors.h
similarity index 96%
rename from upb/upb/message/accessors.h
rename to upb/message/accessors.h
index 9fe6ab1..14896a0 100644
--- a/upb/upb/message/accessors.h
+++ b/upb/message/accessors.h
@@ -8,18 +8,18 @@
 #ifndef UPB_MESSAGE_ACCESSORS_H_
 #define UPB_MESSAGE_ACCESSORS_H_
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/collections/array.h"
-#include "upb/upb/collections/internal/array.h"
-#include "upb/upb/collections/internal/map.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/message/internal/accessors.h"
-#include "upb/upb/message/internal/message.h"
-#include "upb/upb/mini_table/enum.h"
-#include "upb/upb/mini_table/field.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/collections/array.h"
+#include "upb/collections/internal/array.h"
+#include "upb/collections/internal/map.h"
+#include "upb/collections/map.h"
+#include "upb/message/internal/accessors.h"
+#include "upb/message/internal/message.h"
+#include "upb/mini_table/enum.h"
+#include "upb/mini_table/field.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -375,6 +375,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MESSAGE_ACCESSORS_H_
diff --git a/upb/upb/message/accessors_split64.h b/upb/message/accessors_split64.h
similarity index 95%
rename from upb/upb/message/accessors_split64.h
rename to upb/message/accessors_split64.h
index c04142c..e284bb1 100644
--- a/upb/upb/message/accessors_split64.h
+++ b/upb/message/accessors_split64.h
@@ -8,10 +8,10 @@
 #ifndef UPB_MESSAGE_ACCESSORS_SPLIT64_H_
 #define UPB_MESSAGE_ACCESSORS_SPLIT64_H_
 
-#include "upb/upb/message/accessors.h"
+#include "upb/message/accessors.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -61,6 +61,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MESSAGE_ACCESSORS_SPLIT64_H_
diff --git a/upb/upb/message/accessors_test.cc b/upb/message/accessors_test.cc
similarity index 97%
rename from upb/upb/message/accessors_test.cc
rename to upb/message/accessors_test.cc
index a25df5f..b8b6569 100644
--- a/upb/upb/message/accessors_test.cc
+++ b/upb/message/accessors_test.cc
@@ -11,23 +11,23 @@
  * accessed through reflective APIs exposed through mini table accessors.
  */
 
-#include "upb/upb/message/accessors.h"
+#include "upb/message/accessors.h"
 
 #include <string>
 
 #include <gtest/gtest.h>
 #include "google/protobuf/test_messages_proto2.upb.h"
 #include "google/protobuf/test_messages_proto3.upb.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/collections/array.h"
-#include "upb/upb/mini_descriptor/decode.h"
-#include "upb/upb/mini_descriptor/internal/encode.hpp"
-#include "upb/upb/mini_descriptor/internal/modifiers.h"
-#include "upb/upb/test/test.upb.h"
-#include "upb/upb/wire/decode.h"
+#include "upb/base/string_view.h"
+#include "upb/collections/array.h"
+#include "upb/mini_descriptor/decode.h"
+#include "upb/mini_descriptor/internal/encode.hpp"
+#include "upb/mini_descriptor/internal/modifiers.h"
+#include "upb/test/test.upb.h"
+#include "upb/wire/decode.h"
 
 // Must be last
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace {
 
diff --git a/upb/upb/message/copy.c b/upb/message/copy.c
similarity index 96%
rename from upb/upb/message/copy.c
rename to upb/message/copy.c
index f042ba9..2747a0c 100644
--- a/upb/upb/message/copy.c
+++ b/upb/message/copy.c
@@ -5,22 +5,22 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/message/copy.h"
+#include "upb/message/copy.h"
 
 #include <stdbool.h>
 #include <string.h>
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/accessors.h"
-#include "upb/upb/message/internal/message.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/internal/field.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/base/string_view.h"
+#include "upb/mem/arena.h"
+#include "upb/message/accessors.h"
+#include "upb/message/internal/message.h"
+#include "upb/message/message.h"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/internal/field.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 static bool upb_MessageField_IsMap(const upb_MiniTableField* field) {
   return upb_FieldMode_Get(field) == kUpb_FieldMode_Map;
diff --git a/upb/upb/message/copy.h b/upb/message/copy.h
similarity index 86%
rename from upb/upb/message/copy.h
rename to upb/message/copy.h
index 063fdc7..9377d29 100644
--- a/upb/upb/message/copy.h
+++ b/upb/message/copy.h
@@ -8,13 +8,13 @@
 #ifndef UPB_MESSAGE_COPY_H_
 #define UPB_MESSAGE_COPY_H_
 
-#include "upb/upb/collections/array.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mini_table/message.h"
+#include "upb/collections/array.h"
+#include "upb/collections/map.h"
+#include "upb/mem/arena.h"
+#include "upb/mini_table/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -43,6 +43,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MESSAGE_COPY_H_
diff --git a/upb/upb/message/copy_test.cc b/upb/message/copy_test.cc
similarity index 97%
rename from upb/upb/message/copy_test.cc
rename to upb/message/copy_test.cc
index 1d17c86..f9bbff5 100644
--- a/upb/upb/message/copy_test.cc
+++ b/upb/message/copy_test.cc
@@ -11,7 +11,7 @@
  * accessed through reflective APIs exposed through mini table accessors.
  */
 
-#include "upb/upb/message/copy.h"
+#include "upb/message/copy.h"
 
 #include <cstddef>
 #include <cstdint>
@@ -21,14 +21,14 @@
 
 #include <gtest/gtest.h>
 #include "google/protobuf/test_messages_proto2.upb.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/accessors.h"
-#include "upb/upb/message/internal/message.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/mini_table/message.h"
-#include "upb/upb/wire/encode.h"
+#include "upb/base/string_view.h"
+#include "upb/collections/map.h"
+#include "upb/mem/arena.h"
+#include "upb/message/accessors.h"
+#include "upb/message/internal/message.h"
+#include "upb/message/message.h"
+#include "upb/mini_table/message.h"
+#include "upb/wire/encode.h"
 
 namespace {
 
diff --git a/upb/upb/message/internal/accessors.h b/upb/message/internal/accessors.h
similarity index 97%
rename from upb/upb/message/internal/accessors.h
rename to upb/message/internal/accessors.h
index c630822..d71a999 100644
--- a/upb/upb/message/internal/accessors.h
+++ b/upb/message/internal/accessors.h
@@ -8,13 +8,13 @@
 #ifndef UPB_MESSAGE_INTERNAL_ACCESSORS_H_
 #define UPB_MESSAGE_INTERNAL_ACCESSORS_H_
 
-#include "upb/upb/collections/internal/map.h"
-#include "upb/upb/message/internal/extension.h"
-#include "upb/upb/message/internal/message.h"
-#include "upb/upb/mini_table/internal/field.h"
+#include "upb/collections/internal/map.h"
+#include "upb/message/internal/extension.h"
+#include "upb/message/internal/message.h"
+#include "upb/mini_table/internal/field.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #if defined(__GNUC__) && !defined(__clang__)
 // GCC raises incorrect warnings in these functions.  It thinks that we are
@@ -362,6 +362,6 @@
 #pragma GCC diagnostic pop
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MESSAGE_INTERNAL_ACCESSORS_H_
diff --git a/upb/upb/message/internal/extension.h b/upb/message/internal/extension.h
similarity index 87%
rename from upb/upb/message/internal/extension.h
rename to upb/message/internal/extension.h
index 6e8b051..ab653ab 100644
--- a/upb/upb/message/internal/extension.h
+++ b/upb/message/internal/extension.h
@@ -8,14 +8,14 @@
 #ifndef UPB_MESSAGE_INTERNAL_EXTENSION_H_
 #define UPB_MESSAGE_INTERNAL_EXTENSION_H_
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/mini_table/extension.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/base/string_view.h"
+#include "upb/mem/arena.h"
+#include "upb/message/message.h"
+#include "upb/mini_table/extension.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // The internal representation of an extension is self-describing: it contains
 // enough information that we can serialize it to binary format without needing
@@ -58,6 +58,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MESSAGE_INTERNAL_EXTENSION_H_ */
diff --git a/upb/upb/message/internal/message.h b/upb/message/internal/message.h
similarity index 90%
rename from upb/upb/message/internal/message.h
rename to upb/message/internal/message.h
index fd33663..d270a01 100644
--- a/upb/upb/message/internal/message.h
+++ b/upb/message/internal/message.h
@@ -18,15 +18,15 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "upb/upb/message/internal/extension.h"
-#include "upb/upb/message/internal/types.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/mini_table/extension.h"
-#include "upb/upb/mini_table/extension_registry.h"
-#include "upb/upb/mini_table/message.h"
+#include "upb/message/internal/extension.h"
+#include "upb/message/internal/types.h"
+#include "upb/message/message.h"
+#include "upb/mini_table/extension.h"
+#include "upb/mini_table/extension_registry.h"
+#include "upb/mini_table/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -101,6 +101,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MESSAGE_INTERNAL_H_ */
diff --git a/upb/upb/message/internal/types.h b/upb/message/internal/types.h
similarity index 100%
rename from upb/upb/message/internal/types.h
rename to upb/message/internal/types.h
diff --git a/upb/upb/message/message.c b/upb/message/message.c
similarity index 96%
rename from upb/upb/message/message.c
rename to upb/message/message.c
index a85c5e9..265d30d 100644
--- a/upb/upb/message/message.c
+++ b/upb/message/message.c
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/message/message.h"
+#include "upb/message/message.h"
 
 #include <math.h>
 
-#include "upb/upb/base/internal/log2.h"
-#include "upb/upb/message/internal/message.h"
+#include "upb/base/internal/log2.h"
+#include "upb/message/internal/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 const float kUpb_FltInfinity = INFINITY;
 const double kUpb_Infinity = INFINITY;
diff --git a/upb/upb/message/message.h b/upb/message/message.h
similarity index 87%
rename from upb/upb/message/message.h
rename to upb/message/message.h
index 5ffd544..705803a 100644
--- a/upb/upb/message/message.h
+++ b/upb/message/message.h
@@ -14,12 +14,12 @@
 
 #include <stddef.h>
 
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/types.h"  // IWYU pragma: export
-#include "upb/upb/mini_table/message.h"
+#include "upb/mem/arena.h"
+#include "upb/message/types.h"  // IWYU pragma: export
+#include "upb/mini_table/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -47,6 +47,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MESSAGE_MESSAGE_H_ */
diff --git a/upb/upb/message/promote.c b/upb/message/promote.c
similarity index 94%
rename from upb/upb/message/promote.c
rename to upb/message/promote.c
index 1bb730f..3e4c6db 100644
--- a/upb/upb/message/promote.c
+++ b/upb/message/promote.c
@@ -5,34 +5,34 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/message/promote.h"
+#include "upb/message/promote.h"
 
 #include <stdbool.h>
 #include <stdint.h>
 #include <string.h>
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/collections/array.h"
-#include "upb/upb/collections/internal/array.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/accessors.h"
-#include "upb/upb/message/internal/accessors.h"
-#include "upb/upb/message/internal/extension.h"
-#include "upb/upb/message/internal/message.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/message/tagged_ptr.h"
-#include "upb/upb/mini_table/extension.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/internal/field.h"
-#include "upb/upb/mini_table/message.h"
-#include "upb/upb/wire/decode.h"
-#include "upb/upb/wire/eps_copy_input_stream.h"
-#include "upb/upb/wire/internal/constants.h"
-#include "upb/upb/wire/reader.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/collections/array.h"
+#include "upb/collections/internal/array.h"
+#include "upb/collections/map.h"
+#include "upb/mem/arena.h"
+#include "upb/message/accessors.h"
+#include "upb/message/internal/accessors.h"
+#include "upb/message/internal/extension.h"
+#include "upb/message/internal/message.h"
+#include "upb/message/message.h"
+#include "upb/message/tagged_ptr.h"
+#include "upb/mini_table/extension.h"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/internal/field.h"
+#include "upb/mini_table/message.h"
+#include "upb/wire/decode.h"
+#include "upb/wire/eps_copy_input_stream.h"
+#include "upb/wire/internal/constants.h"
+#include "upb/wire/reader.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // Parses unknown data by merging into existing base_message or creating a
 // new message usingg mini_table.
diff --git a/upb/upb/message/promote.h b/upb/message/promote.h
similarity index 96%
rename from upb/upb/message/promote.h
rename to upb/message/promote.h
index 83acd36..dfa9fdc 100644
--- a/upb/upb/message/promote.h
+++ b/upb/message/promote.h
@@ -8,13 +8,13 @@
 #ifndef UPB_MESSAGE_PROMOTE_H_
 #define UPB_MESSAGE_PROMOTE_H_
 
-#include "upb/upb/collections/array.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/message/internal/extension.h"
-#include "upb/upb/wire/decode.h"
+#include "upb/collections/array.h"
+#include "upb/collections/map.h"
+#include "upb/message/internal/extension.h"
+#include "upb/wire/decode.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -156,6 +156,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MESSAGE_PROMOTE_H_
diff --git a/upb/upb/message/promote_test.cc b/upb/message/promote_test.cc
similarity index 98%
rename from upb/upb/message/promote_test.cc
rename to upb/message/promote_test.cc
index 3887ef3..6adf9a4 100644
--- a/upb/upb/message/promote_test.cc
+++ b/upb/message/promote_test.cc
@@ -11,25 +11,25 @@
  * accessed through reflective APIs exposed through mini table accessors.
  */
 
-#include "upb/upb/message/promote.h"
+#include "upb/message/promote.h"
 
 #include <string>
 
 #include <gtest/gtest.h>
 #include "google/protobuf/test_messages_proto2.upb.h"
 #include "google/protobuf/test_messages_proto3.upb.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/collections/array.h"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/message/accessors.h"
-#include "upb/upb/message/copy.h"
-#include "upb/upb/mini_descriptor/internal/encode.hpp"
-#include "upb/upb/mini_descriptor/internal/modifiers.h"
-#include "upb/upb/test/test.upb.h"
-#include "upb/upb/wire/decode.h"
+#include "upb/base/string_view.h"
+#include "upb/collections/array.h"
+#include "upb/mem/arena.hpp"
+#include "upb/message/accessors.h"
+#include "upb/message/copy.h"
+#include "upb/mini_descriptor/internal/encode.hpp"
+#include "upb/mini_descriptor/internal/modifiers.h"
+#include "upb/test/test.upb.h"
+#include "upb/wire/decode.h"
 
 // Must be last
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace {
 
diff --git a/upb/upb/message/tagged_ptr.h b/upb/message/tagged_ptr.h
similarity index 94%
rename from upb/upb/message/tagged_ptr.h
rename to upb/message/tagged_ptr.h
index 34f88e8..2596cd7 100644
--- a/upb/upb/message/tagged_ptr.h
+++ b/upb/message/tagged_ptr.h
@@ -10,10 +10,10 @@
 
 #include <stdint.h>
 
-#include "upb/upb/message/types.h"  // IWYU pragma: export
+#include "upb/message/types.h"  // IWYU pragma: export
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -64,6 +64,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_TYPES_H_ */
diff --git a/upb/upb/message/test.cc b/upb/message/test.cc
similarity index 98%
rename from upb/upb/message/test.cc
rename to upb/message/test.cc
index 3ab560f..d28f60a 100644
--- a/upb/upb/message/test.cc
+++ b/upb/message/test.cc
@@ -11,15 +11,15 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include "google/protobuf/test_messages_proto3.upb.h"
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/json/decode.h"
-#include "upb/upb/json/encode.h"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/message/test.upb.h"
-#include "upb/upb/message/test.upbdefs.h"
-#include "upb/upb/reflection/def.hpp"
-#include "upb/upb/test/fuzz_util.h"
-#include "upb/upb/wire/decode.h"
+#include "upb/base/status.hpp"
+#include "upb/json/decode.h"
+#include "upb/json/encode.h"
+#include "upb/mem/arena.hpp"
+#include "upb/message/test.upb.h"
+#include "upb/message/test.upbdefs.h"
+#include "upb/reflection/def.hpp"
+#include "upb/test/fuzz_util.h"
+#include "upb/wire/decode.h"
 
 // begin:google_only
 // #include "testing/fuzzing/fuzztest.h"
diff --git a/upb/upb/message/test.proto b/upb/message/test.proto
similarity index 100%
rename from upb/upb/message/test.proto
rename to upb/message/test.proto
diff --git a/upb/upb/message/types.h b/upb/message/types.h
similarity index 100%
rename from upb/upb/message/types.h
rename to upb/message/types.h
diff --git a/upb/upb/message/utf8_test.cc b/upb/message/utf8_test.cc
similarity index 96%
rename from upb/upb/message/utf8_test.cc
rename to upb/message/utf8_test.cc
index a6e3109..5f63bb2 100644
--- a/upb/upb/message/utf8_test.cc
+++ b/upb/message/utf8_test.cc
@@ -31,11 +31,11 @@
 #include <stdlib.h>
 
 #include <gtest/gtest.h>
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/message/utf8_test.upb.h"
-#include "upb/upb/wire/decode.h"
+#include "upb/base/string_view.h"
+#include "upb/mem/arena.h"
+#include "upb/mem/arena.hpp"
+#include "upb/message/utf8_test.upb.h"
+#include "upb/wire/decode.h"
 
 namespace {
 
diff --git a/upb/upb/message/utf8_test.proto b/upb/message/utf8_test.proto
similarity index 100%
rename from upb/upb/message/utf8_test.proto
rename to upb/message/utf8_test.proto
diff --git a/upb/upb/message/value.h b/upb/message/value.h
similarity index 86%
rename from upb/upb/message/value.h
rename to upb/message/value.h
index 1199dde..954d88a 100644
--- a/upb/upb/message/value.h
+++ b/upb/message/value.h
@@ -6,16 +6,16 @@
 // https://developers.google.com/open-source/licenses/bsd
 
 // Users should include array.h or map.h instead.
-// IWYU pragma: private, include "upb/upb/collections/array.h"
+// IWYU pragma: private, include "upb/collections/array.h"
 
 #ifndef UPB_MESSAGE_VALUE_H_
 #define UPB_MESSAGE_VALUE_H_
 
 #include <stdint.h>
 
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/message/tagged_ptr.h"
-#include "upb/upb/message/types.h"
+#include "upb/base/string_view.h"
+#include "upb/message/tagged_ptr.h"
+#include "upb/message/types.h"
 
 typedef union {
   bool bool_val;
diff --git a/upb/upb/mini_descriptor/BUILD b/upb/mini_descriptor/BUILD
similarity index 95%
rename from upb/upb/mini_descriptor/BUILD
rename to upb/mini_descriptor/BUILD
index 5bdade7..d642791 100644
--- a/upb/upb/mini_descriptor/BUILD
+++ b/upb/mini_descriptor/BUILD
@@ -1,5 +1,5 @@
 load(
-    "//upb/bazel:build_defs.bzl",
+    "//bazel:build_defs.bzl",
     "UPB_DEFAULT_COPTS",
     "UPB_DEFAULT_CPPOPTS",
 )
@@ -59,13 +59,13 @@
         ":internal",
         ":mini_descriptor",
         "//:protobuf",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:mem",
         "//upb:message_accessors_internal",
         "//upb:mini_table",
         "//upb:wire",
         "@com_google_absl//absl/container:flat_hash_set",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -80,7 +80,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/mini_descriptor/build_enum.c b/upb/mini_descriptor/build_enum.c
similarity index 94%
rename from upb/upb/mini_descriptor/build_enum.c
rename to upb/mini_descriptor/build_enum.c
index 68f0a6d..738c591 100644
--- a/upb/upb/mini_descriptor/build_enum.c
+++ b/upb/mini_descriptor/build_enum.c
@@ -5,14 +5,14 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mini_descriptor/build_enum.h"
+#include "upb/mini_descriptor/build_enum.h"
 
-#include "upb/upb/mini_descriptor/internal/decoder.h"
-#include "upb/upb/mini_descriptor/internal/wire_constants.h"
-#include "upb/upb/mini_table/internal/enum.h"
+#include "upb/mini_descriptor/internal/decoder.h"
+#include "upb/mini_descriptor/internal/wire_constants.h"
+#include "upb/mini_table/internal/enum.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct {
   upb_MdDecoder base;
diff --git a/upb/upb/mini_descriptor/build_enum.h b/upb/mini_descriptor/build_enum.h
similarity index 88%
rename from upb/upb/mini_descriptor/build_enum.h
rename to upb/mini_descriptor/build_enum.h
index 7619897..c4b9515 100644
--- a/upb/upb/mini_descriptor/build_enum.h
+++ b/upb/mini_descriptor/build_enum.h
@@ -7,12 +7,12 @@
 #ifndef UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
 #define UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
 
-#include "upb/upb/base/status.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mini_table/enum.h"
+#include "upb/base/status.h"
+#include "upb/mem/arena.h"
+#include "upb/mini_table/enum.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -37,6 +37,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
diff --git a/upb/upb/mini_descriptor/decode.c b/upb/mini_descriptor/decode.c
similarity index 98%
rename from upb/upb/mini_descriptor/decode.c
rename to upb/mini_descriptor/decode.c
index 09bf6e1..6575e92 100644
--- a/upb/upb/mini_descriptor/decode.c
+++ b/upb/mini_descriptor/decode.c
@@ -5,22 +5,22 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mini_descriptor/decode.h"
+#include "upb/mini_descriptor/decode.h"
 
 #include <inttypes.h>
 #include <stdlib.h>
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mini_descriptor/internal/base92.h"
-#include "upb/upb/mini_descriptor/internal/decoder.h"
-#include "upb/upb/mini_descriptor/internal/modifiers.h"
-#include "upb/upb/mini_descriptor/internal/wire_constants.h"
-#include "upb/upb/mini_table/internal/field.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/base/string_view.h"
+#include "upb/mem/arena.h"
+#include "upb/mini_descriptor/internal/base92.h"
+#include "upb/mini_descriptor/internal/decoder.h"
+#include "upb/mini_descriptor/internal/modifiers.h"
+#include "upb/mini_descriptor/internal/wire_constants.h"
+#include "upb/mini_table/internal/field.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // Note: we sort by this number when calculating layout order.
 typedef enum {
diff --git a/upb/upb/mini_descriptor/decode.h b/upb/mini_descriptor/decode.h
similarity index 92%
rename from upb/upb/mini_descriptor/decode.h
rename to upb/mini_descriptor/decode.h
index 4b1aa61..ec7c12e 100644
--- a/upb/upb/mini_descriptor/decode.h
+++ b/upb/mini_descriptor/decode.h
@@ -8,22 +8,22 @@
 #ifndef UPB_MINI_TABLE_DECODE_H_
 #define UPB_MINI_TABLE_DECODE_H_
 
-#include "upb/upb/base/status.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mini_table/extension.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/message.h"
-#include "upb/upb/mini_table/sub.h"
+#include "upb/base/status.h"
+#include "upb/mem/arena.h"
+#include "upb/mini_table/extension.h"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/message.h"
+#include "upb/mini_table/sub.h"
 
 // Export the newer headers, for legacy users.  New users should include the
 // more specific headers directly.
 // IWYU pragma: begin_exports
-#include "upb/upb/mini_descriptor/build_enum.h"
-#include "upb/upb/mini_descriptor/link.h"
+#include "upb/mini_descriptor/build_enum.h"
+#include "upb/mini_descriptor/link.h"
 // IWYU pragma: end_exports
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef enum {
   kUpb_MiniTablePlatform_32Bit,
@@ -115,6 +115,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_DECODE_H_ */
diff --git a/upb/upb/mini_descriptor/internal/base92.c b/upb/mini_descriptor/internal/base92.c
similarity index 95%
rename from upb/upb/mini_descriptor/internal/base92.c
rename to upb/mini_descriptor/internal/base92.c
index af0e160..18783d9 100644
--- a/upb/upb/mini_descriptor/internal/base92.c
+++ b/upb/mini_descriptor/internal/base92.c
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mini_descriptor/internal/base92.h"
+#include "upb/mini_descriptor/internal/base92.h"
 
 const char _kUpb_ToBase92[] = {
     ' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/',
diff --git a/upb/upb/mini_descriptor/internal/base92.h b/upb/mini_descriptor/internal/base92.h
similarity index 93%
rename from upb/upb/mini_descriptor/internal/base92.h
rename to upb/mini_descriptor/internal/base92.h
index 2180974..4201c25 100644
--- a/upb/upb/mini_descriptor/internal/base92.h
+++ b/upb/mini_descriptor/internal/base92.h
@@ -10,10 +10,10 @@
 
 #include <stdint.h>
 
-#include "upb/upb/base/internal/log2.h"
+#include "upb/base/internal/log2.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -58,6 +58,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
diff --git a/upb/upb/mini_descriptor/internal/decoder.h b/upb/mini_descriptor/internal/decoder.h
similarity index 90%
rename from upb/upb/mini_descriptor/internal/decoder.h
rename to upb/mini_descriptor/internal/decoder.h
index d1786a4..9ac3282 100644
--- a/upb/upb/mini_descriptor/internal/decoder.h
+++ b/upb/mini_descriptor/internal/decoder.h
@@ -8,11 +8,11 @@
 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
 #define UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
 
-#include "upb/upb/base/status.h"
-#include "upb/upb/mini_descriptor/internal/base92.h"
+#include "upb/base/status.h"
+#include "upb/mini_descriptor/internal/base92.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // upb_MdDecoder: used internally for decoding MiniDescriptors for messages,
 // extensions, and enums.
@@ -48,6 +48,6 @@
   return ptr;
 }
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
diff --git a/upb/upb/mini_descriptor/internal/encode.c b/upb/mini_descriptor/internal/encode.c
similarity index 97%
rename from upb/upb/mini_descriptor/internal/encode.c
rename to upb/mini_descriptor/internal/encode.c
index ec56d0d..2193ffe 100644
--- a/upb/upb/mini_descriptor/internal/encode.c
+++ b/upb/mini_descriptor/internal/encode.c
@@ -5,19 +5,19 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mini_descriptor/internal/encode.h"
+#include "upb/mini_descriptor/internal/encode.h"
 
 #include <assert.h>
 #include <stddef.h>
 #include <stdint.h>
 
-#include "upb/upb/base/internal/log2.h"
-#include "upb/upb/mini_descriptor/internal/base92.h"
-#include "upb/upb/mini_descriptor/internal/modifiers.h"
-#include "upb/upb/mini_descriptor/internal/wire_constants.h"
+#include "upb/base/internal/log2.h"
+#include "upb/mini_descriptor/internal/base92.h"
+#include "upb/mini_descriptor/internal/modifiers.h"
+#include "upb/mini_descriptor/internal/wire_constants.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct {
   uint64_t present_values_mask;
diff --git a/upb/upb/mini_descriptor/internal/encode.h b/upb/mini_descriptor/internal/encode.h
similarity index 96%
rename from upb/upb/mini_descriptor/internal/encode.h
rename to upb/mini_descriptor/internal/encode.h
index 3a1f55f..3180f0b 100644
--- a/upb/upb/mini_descriptor/internal/encode.h
+++ b/upb/mini_descriptor/internal/encode.h
@@ -10,10 +10,10 @@
 
 #include <stdint.h>
 
-#include "upb/upb/base/descriptor_constants.h"
+#include "upb/base/descriptor_constants.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // If the input buffer has at least this many bytes available, the encoder call
 // is guaranteed to succeed (as long as field number order is maintained).
@@ -87,6 +87,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_ */
diff --git a/upb/upb/mini_descriptor/internal/encode.hpp b/upb/mini_descriptor/internal/encode.hpp
similarity index 97%
rename from upb/upb/mini_descriptor/internal/encode.hpp
rename to upb/mini_descriptor/internal/encode.hpp
index 98787cb..cfa3bed 100644
--- a/upb/upb/mini_descriptor/internal/encode.hpp
+++ b/upb/mini_descriptor/internal/encode.hpp
@@ -10,8 +10,8 @@
 
 #include <string>
 
-#include "upb/upb/base/internal/log2.h"
-#include "upb/upb/mini_descriptor/internal/encode.h"
+#include "upb/base/internal/log2.h"
+#include "upb/mini_descriptor/internal/encode.h"
 
 namespace upb {
 
diff --git a/upb/upb/mini_descriptor/internal/encode_test.cc b/upb/mini_descriptor/internal/encode_test.cc
similarity index 95%
rename from upb/upb/mini_descriptor/internal/encode_test.cc
rename to upb/mini_descriptor/internal/encode_test.cc
index 13a9e16..dcb33b5 100644
--- a/upb/upb/mini_descriptor/internal/encode_test.cc
+++ b/upb/mini_descriptor/internal/encode_test.cc
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mini_descriptor/internal/encode.hpp"
+#include "upb/mini_descriptor/internal/encode.hpp"
 
 #include <string_view>
 #include <vector>
@@ -14,14 +14,14 @@
 #include <gtest/gtest.h>
 #include "absl/container/flat_hash_set.h"
 #include "google/protobuf/descriptor.h"
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/message/internal/accessors.h"
-#include "upb/upb/mini_descriptor/decode.h"
-#include "upb/upb/mini_descriptor/internal/base92.h"
-#include "upb/upb/mini_descriptor/internal/modifiers.h"
-#include "upb/upb/mini_table/enum.h"
-#include "upb/upb/wire/decode.h"
+#include "upb/base/status.hpp"
+#include "upb/mem/arena.hpp"
+#include "upb/message/internal/accessors.h"
+#include "upb/mini_descriptor/decode.h"
+#include "upb/mini_descriptor/internal/base92.h"
+#include "upb/mini_descriptor/internal/modifiers.h"
+#include "upb/mini_table/enum.h"
+#include "upb/wire/decode.h"
 
 // begin:google_only
 // #include "testing/fuzzing/fuzztest.h"
diff --git a/upb/upb/mini_descriptor/internal/modifiers.h b/upb/mini_descriptor/internal/modifiers.h
similarity index 93%
rename from upb/upb/mini_descriptor/internal/modifiers.h
rename to upb/mini_descriptor/internal/modifiers.h
index b0fdc87..103b279 100644
--- a/upb/upb/mini_descriptor/internal/modifiers.h
+++ b/upb/mini_descriptor/internal/modifiers.h
@@ -9,7 +9,7 @@
 #define UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef enum {
   kUpb_FieldModifier_IsRepeated = 1 << 0,
@@ -27,6 +27,6 @@
   kUpb_MessageModifier_IsExtendable = 1 << 2,
 } kUpb_MessageModifier;
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
diff --git a/upb/upb/mini_descriptor/internal/wire_constants.h b/upb/mini_descriptor/internal/wire_constants.h
similarity index 94%
rename from upb/upb/mini_descriptor/internal/wire_constants.h
rename to upb/mini_descriptor/internal/wire_constants.h
index 724f081..569da57 100644
--- a/upb/upb/mini_descriptor/internal/wire_constants.h
+++ b/upb/mini_descriptor/internal/wire_constants.h
@@ -8,10 +8,10 @@
 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
 #define UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
 
-#include "upb/upb/base/descriptor_constants.h"
+#include "upb/base/descriptor_constants.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef enum {
   kUpb_EncodedType_Double = 0,
@@ -67,6 +67,6 @@
   kUpb_EncodedVersion_MessageSetV1 = '&',
 };
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
diff --git a/upb/upb/mini_descriptor/link.c b/upb/mini_descriptor/link.c
similarity index 97%
rename from upb/upb/mini_descriptor/link.c
rename to upb/mini_descriptor/link.c
index 7c860af..39da601 100644
--- a/upb/upb/mini_descriptor/link.c
+++ b/upb/mini_descriptor/link.c
@@ -5,10 +5,10 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mini_descriptor/link.h"
+#include "upb/mini_descriptor/link.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 bool upb_MiniTable_SetSubMessage(upb_MiniTable* table,
                                  upb_MiniTableField* field,
diff --git a/upb/upb/mini_descriptor/link.h b/upb/mini_descriptor/link.h
similarity index 91%
rename from upb/upb/mini_descriptor/link.h
rename to upb/mini_descriptor/link.h
index 55296a1..db3aac1 100644
--- a/upb/upb/mini_descriptor/link.h
+++ b/upb/mini_descriptor/link.h
@@ -16,15 +16,15 @@
 #ifndef UPB_MINI_DESCRIPTOR_LINK_H_
 #define UPB_MINI_DESCRIPTOR_LINK_H_
 
-#include "upb/upb/base/status.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mini_table/extension.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/message.h"
-#include "upb/upb/mini_table/sub.h"
+#include "upb/base/status.h"
+#include "upb/mem/arena.h"
+#include "upb/mini_table/extension.h"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/message.h"
+#include "upb/mini_table/sub.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -79,6 +79,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_MINI_DESCRIPTOR_LINK_H_
diff --git a/upb/upb/mini_table/BUILD b/upb/mini_table/BUILD
similarity index 89%
rename from upb/upb/mini_table/BUILD
rename to upb/mini_table/BUILD
index 44d4767..1623c05 100644
--- a/upb/upb/mini_table/BUILD
+++ b/upb/mini_table/BUILD
@@ -6,7 +6,7 @@
 # https://developers.google.com/open-source/licenses/bsd
 
 load(
-    "//upb/bazel:build_defs.bzl",
+    "//bazel:build_defs.bzl",
     "UPB_DEFAULT_COPTS",
 )
 
@@ -81,11 +81,11 @@
     name = "compat_test",
     srcs = ["compat_test.cc"],
     deps = [
-        "//upb:mini_table_compat",
-        "//upb/upb/test:test_messages_proto2_upb_proto",
-        "//upb/upb/test:test_messages_proto3_upb_proto",
-        "//upb/upb/test:test_upb_proto",
         "@com_google_googletest//:gtest_main",
+        "//upb:mini_table_compat",
+        "//upb/test:test_messages_proto2_upb_proto",
+        "//upb/test:test_messages_proto3_upb_proto",
+        "//upb/test:test_upb_proto",
     ],
 )
 
@@ -100,7 +100,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/mini_table/compat.c b/upb/mini_table/compat.c
similarity index 92%
rename from upb/upb/mini_table/compat.c
rename to upb/mini_table/compat.c
index e8fa81d..ad169ce 100644
--- a/upb/upb/mini_table/compat.c
+++ b/upb/mini_table/compat.c
@@ -5,17 +5,17 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mini_table/compat.h"
+#include "upb/mini_table/compat.h"
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/hash/common.h"
-#include "upb/upb/hash/int_table.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/message.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/hash/common.h"
+#include "upb/hash/int_table.h"
+#include "upb/mem/arena.h"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // Checks if source and target mini table fields are identical.
 //
diff --git a/upb/upb/mini_table/compat.h b/upb/mini_table/compat.h
similarity index 92%
rename from upb/upb/mini_table/compat.h
rename to upb/mini_table/compat.h
index 091d878..fd1670d 100644
--- a/upb/upb/mini_table/compat.h
+++ b/upb/mini_table/compat.h
@@ -8,10 +8,10 @@
 #ifndef UPB_MINI_TABLE_COMPAT_H_
 #define UPB_MINI_TABLE_COMPAT_H_
 
-#include "upb/upb/mini_table/message.h"
+#include "upb/mini_table/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // upb does not support mixing minitables from different sources but these
 // functions are still used by some existing users so for now we make them
@@ -40,6 +40,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_COMPAT_H_ */
diff --git a/upb/upb/mini_table/compat_test.cc b/upb/mini_table/compat_test.cc
similarity index 96%
rename from upb/upb/mini_table/compat_test.cc
rename to upb/mini_table/compat_test.cc
index 59ae5cd..e999e17 100644
--- a/upb/upb/mini_table/compat_test.cc
+++ b/upb/mini_table/compat_test.cc
@@ -11,7 +11,7 @@
  * accessed through reflective APIs exposed through mini table accessors.
  */
 
-#include "upb/upb/mini_table/compat.h"
+#include "upb/mini_table/compat.h"
 
 #include <gtest/gtest.h>
 #include "google/protobuf/test_messages_proto2.upb.h"
diff --git a/upb/upb/mini_table/enum.h b/upb/mini_table/enum.h
similarity index 89%
rename from upb/upb/mini_table/enum.h
rename to upb/mini_table/enum.h
index 6087a75..c2810fb 100644
--- a/upb/upb/mini_table/enum.h
+++ b/upb/mini_table/enum.h
@@ -8,10 +8,10 @@
 #ifndef UPB_MINI_TABLE_ENUM_H_
 #define UPB_MINI_TABLE_ENUM_H_
 
-#include "upb/upb/mini_table/internal/enum.h"
+#include "upb/mini_table/internal/enum.h"
 
 // Must be last
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct upb_MiniTableEnum upb_MiniTableEnum;
 
@@ -33,6 +33,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_ENUM_H_ */
diff --git a/upb/upb/mini_table/extension.h b/upb/mini_table/extension.h
similarity index 89%
rename from upb/upb/mini_table/extension.h
rename to upb/mini_table/extension.h
index a883534..7fde315 100644
--- a/upb/upb/mini_table/extension.h
+++ b/upb/mini_table/extension.h
@@ -8,7 +8,7 @@
 #ifndef UPB_MINI_TABLE_EXTENSION_H_
 #define UPB_MINI_TABLE_EXTENSION_H_
 
-#include "upb/upb/mini_table/internal/extension.h"
+#include "upb/mini_table/internal/extension.h"
 
 typedef struct upb_MiniTableExtension upb_MiniTableExtension;
 
diff --git a/upb/upb/mini_table/extension_registry.c b/upb/mini_table/extension_registry.c
similarity index 93%
rename from upb/upb/mini_table/extension_registry.c
rename to upb/mini_table/extension_registry.c
index b1329f2..3c3f58f 100644
--- a/upb/upb/mini_table/extension_registry.c
+++ b/upb/mini_table/extension_registry.c
@@ -5,13 +5,13 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mini_table/extension_registry.h"
+#include "upb/mini_table/extension_registry.h"
 
-#include "upb/upb/hash/str_table.h"
-#include "upb/upb/mini_table/extension.h"
+#include "upb/hash/str_table.h"
+#include "upb/mini_table/extension.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #define EXTREG_KEY_SIZE (sizeof(upb_MiniTable*) + sizeof(uint32_t))
 
diff --git a/upb/upb/mini_table/extension_registry.h b/upb/mini_table/extension_registry.h
similarity index 94%
rename from upb/upb/mini_table/extension_registry.h
rename to upb/mini_table/extension_registry.h
index bb90572..0465140 100644
--- a/upb/upb/mini_table/extension_registry.h
+++ b/upb/mini_table/extension_registry.h
@@ -8,12 +8,12 @@
 #ifndef UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
 #define UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
 
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mini_table/extension.h"
-#include "upb/upb/mini_table/message.h"
+#include "upb/mem/arena.h"
+#include "upb/mini_table/extension.h"
+#include "upb/mini_table/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -80,6 +80,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ */
diff --git a/upb/upb/mini_table/field.h b/upb/mini_table/field.h
similarity index 92%
rename from upb/upb/mini_table/field.h
rename to upb/mini_table/field.h
index 082a9cc..7f382c4 100644
--- a/upb/upb/mini_table/field.h
+++ b/upb/mini_table/field.h
@@ -8,12 +8,12 @@
 #ifndef UPB_MINI_TABLE_FIELD_H_
 #define UPB_MINI_TABLE_FIELD_H_
 
-#include "upb/upb/mini_table/internal/field.h"
-#include "upb/upb/mini_table/internal/message.h"
-#include "upb/upb/mini_table/internal/sub.h"
+#include "upb/mini_table/internal/field.h"
+#include "upb/mini_table/internal/message.h"
+#include "upb/mini_table/internal/sub.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -93,6 +93,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_FIELD_H_ */
diff --git a/upb/upb/mini_table/file.h b/upb/mini_table/file.h
similarity index 90%
rename from upb/upb/mini_table/file.h
rename to upb/mini_table/file.h
index 67a4f4d..590164f 100644
--- a/upb/upb/mini_table/file.h
+++ b/upb/mini_table/file.h
@@ -8,7 +8,7 @@
 #ifndef UPB_MINI_TABLE_FILE_H_
 #define UPB_MINI_TABLE_FILE_H_
 
-#include "upb/upb/mini_table/internal/file.h"
+#include "upb/mini_table/internal/file.h"
 
 typedef struct upb_MiniTableFile upb_MiniTableFile;
 
diff --git a/upb/upb/mini_table/internal/enum.h b/upb/mini_table/internal/enum.h
similarity index 96%
rename from upb/upb/mini_table/internal/enum.h
rename to upb/mini_table/internal/enum.h
index 366132b..bbc353a 100644
--- a/upb/upb/mini_table/internal/enum.h
+++ b/upb/mini_table/internal/enum.h
@@ -11,7 +11,7 @@
 #include <stdint.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_MiniTableEnum {
   uint32_t mask_limit;   // Limit enum value that can be tested with mask.
@@ -53,6 +53,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_INTERNAL_ENUM_H_ */
diff --git a/upb/upb/mini_table/internal/extension.h b/upb/mini_table/internal/extension.h
similarity index 81%
rename from upb/upb/mini_table/internal/extension.h
rename to upb/mini_table/internal/extension.h
index 8400a69..f052fe6 100644
--- a/upb/upb/mini_table/internal/extension.h
+++ b/upb/mini_table/internal/extension.h
@@ -8,11 +8,11 @@
 #ifndef UPB_MINI_TABLE_INTERNAL_EXTENSION_H_
 #define UPB_MINI_TABLE_INTERNAL_EXTENSION_H_
 
-#include "upb/upb/mini_table/internal/field.h"
-#include "upb/upb/mini_table/internal/sub.h"
+#include "upb/mini_table/internal/field.h"
+#include "upb/mini_table/internal/sub.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_MiniTableExtension {
   // Do not move this field. We need to be able to alias pointers.
@@ -22,6 +22,6 @@
   union upb_MiniTableSub sub;  // NULL unless submessage or proto2 enum
 };
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ */
diff --git a/upb/upb/mini_table/internal/field.h b/upb/mini_table/internal/field.h
similarity index 96%
rename from upb/upb/mini_table/internal/field.h
rename to upb/mini_table/internal/field.h
index 03c31cc..3ed8afe 100644
--- a/upb/upb/mini_table/internal/field.h
+++ b/upb/mini_table/internal/field.h
@@ -10,10 +10,10 @@
 
 #include <stdint.h>
 
-#include "upb/upb/base/descriptor_constants.h"
+#include "upb/base/descriptor_constants.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_MiniTableField {
   uint32_t number;
@@ -109,6 +109,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_INTERNAL_FIELD_H_ */
diff --git a/upb/upb/mini_table/internal/file.h b/upb/mini_table/internal/file.h
similarity index 74%
rename from upb/upb/mini_table/internal/file.h
rename to upb/mini_table/internal/file.h
index d8d332f..c8f069f 100644
--- a/upb/upb/mini_table/internal/file.h
+++ b/upb/mini_table/internal/file.h
@@ -8,12 +8,12 @@
 #ifndef UPB_MINI_TABLE_INTERNAL_FILE_H_
 #define UPB_MINI_TABLE_INTERNAL_FILE_H_
 
-#include "upb/upb/mini_table/internal/enum.h"
-#include "upb/upb/mini_table/internal/extension.h"
-#include "upb/upb/mini_table/internal/message.h"
+#include "upb/mini_table/internal/enum.h"
+#include "upb/mini_table/internal/extension.h"
+#include "upb/mini_table/internal/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_MiniTableFile {
   const struct upb_MiniTable** msgs;
@@ -24,6 +24,6 @@
   int ext_count;
 };
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_INTERNAL_FILE_H_ */
diff --git a/upb/upb/mini_table/internal/message.c b/upb/mini_table/internal/message.c
similarity index 91%
rename from upb/upb/mini_table/internal/message.c
rename to upb/mini_table/internal/message.c
index 9b7b133..b25edac 100644
--- a/upb/upb/mini_table/internal/message.c
+++ b/upb/mini_table/internal/message.c
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mini_table/internal/message.h"
+#include "upb/mini_table/internal/message.h"
 
 const struct upb_MiniTable _kUpb_MiniTable_Empty = {
     .subs = NULL,
diff --git a/upb/upb/mini_table/internal/message.h b/upb/mini_table/internal/message.h
similarity index 94%
rename from upb/upb/mini_table/internal/message.h
rename to upb/mini_table/internal/message.h
index 7e48fbf..3457ea2 100644
--- a/upb/upb/mini_table/internal/message.h
+++ b/upb/mini_table/internal/message.h
@@ -8,11 +8,11 @@
 #ifndef UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
 #define UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
 
-#include "upb/upb/message/types.h"
-#include "upb/upb/mini_table/internal/field.h"
+#include "upb/message/types.h"
+#include "upb/mini_table/internal/field.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_Decoder;
 typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
@@ -83,6 +83,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ */
diff --git a/upb/upb/mini_table/internal/sub.h b/upb/mini_table/internal/sub.h
similarity index 84%
rename from upb/upb/mini_table/internal/sub.h
rename to upb/mini_table/internal/sub.h
index 7da38ff..7887dba 100644
--- a/upb/upb/mini_table/internal/sub.h
+++ b/upb/mini_table/internal/sub.h
@@ -7,8 +7,8 @@
 #ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_
 #define UPB_MINI_TABLE_INTERNAL_SUB_H_
 
-#include "upb/upb/mini_table/internal/enum.h"
-#include "upb/upb/mini_table/internal/message.h"
+#include "upb/mini_table/internal/enum.h"
+#include "upb/mini_table/internal/message.h"
 
 union upb_MiniTableSub {
   const struct upb_MiniTable* submsg;
diff --git a/upb/upb/mini_table/message.c b/upb/mini_table/message.c
similarity index 92%
rename from upb/upb/mini_table/message.c
rename to upb/mini_table/message.c
index 9d105d9..56f2301 100644
--- a/upb/upb/mini_table/message.c
+++ b/upb/mini_table/message.c
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/mini_table/message.h"
+#include "upb/mini_table/message.h"
 
 #include <inttypes.h>
 
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mini_table/internal/message.h"
+#include "upb/mem/arena.h"
+#include "upb/mini_table/internal/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 const upb_MiniTableField* upb_MiniTable_FindFieldByNumber(
     const upb_MiniTable* t, uint32_t number) {
diff --git a/upb/upb/mini_table/message.h b/upb/mini_table/message.h
similarity index 93%
rename from upb/upb/mini_table/message.h
rename to upb/mini_table/message.h
index 1f88db0..b53e87e 100644
--- a/upb/upb/mini_table/message.h
+++ b/upb/mini_table/message.h
@@ -8,12 +8,12 @@
 #ifndef UPB_MINI_TABLE_MESSAGE_H_
 #define UPB_MINI_TABLE_MESSAGE_H_
 
-#include "upb/upb/mini_table/enum.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/internal/message.h"
+#include "upb/mini_table/enum.h"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/internal/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -80,6 +80,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_MINI_TABLE_MESSAGE_H_ */
diff --git a/upb/upb/mini_table/sub.h b/upb/mini_table/sub.h
similarity index 90%
rename from upb/upb/mini_table/sub.h
rename to upb/mini_table/sub.h
index 7bcf5ad..1c5d67e 100644
--- a/upb/upb/mini_table/sub.h
+++ b/upb/mini_table/sub.h
@@ -8,7 +8,7 @@
 #ifndef UPB_MINI_TABLE_SUB_H_
 #define UPB_MINI_TABLE_SUB_H_
 
-#include "upb/upb/mini_table/internal/sub.h"
+#include "upb/mini_table/internal/sub.h"
 
 typedef union upb_MiniTableSub upb_MiniTableSub;
 
diff --git a/upb/upb/port/BUILD b/upb/port/BUILD
similarity index 89%
rename from upb/upb/port/BUILD
rename to upb/port/BUILD
index 2157ff0..dc1c343 100644
--- a/upb/upb/port/BUILD
+++ b/upb/port/BUILD
@@ -5,7 +5,7 @@
 # license that can be found in the LICENSE file or at
 # https://developers.google.com/open-source/licenses/bsd
 
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 
 cc_library(
     name = "port",
@@ -38,7 +38,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/port/atomic.h b/upb/port/atomic.h
similarity index 97%
rename from upb/upb/port/atomic.h
rename to upb/port/atomic.h
index 39ebf5a..f13caa8 100644
--- a/upb/upb/port/atomic.h
+++ b/upb/port/atomic.h
@@ -8,7 +8,7 @@
 #ifndef UPB_PORT_ATOMIC_H_
 #define UPB_PORT_ATOMIC_H_
 
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef UPB_USE_C11_ATOMICS
 
@@ -78,6 +78,6 @@
 
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_PORT_ATOMIC_H_
diff --git a/upb/upb/port/def.inc b/upb/port/def.inc
similarity index 98%
rename from upb/upb/port/def.inc
rename to upb/port/def.inc
index 7c72db8..f320821 100644
--- a/upb/upb/port/def.inc
+++ b/upb/port/def.inc
@@ -12,17 +12,17 @@
  *
  * The correct usage is:
  *
- *   #include "upb/upb/foobar.h"
- *   #include "upb/upb/baz.h"
+ *   #include "upb/foobar.h"
+ *   #include "upb/baz.h"
  *
  *   // MUST be last included header.
- *   #include "upb/upb/port/def.inc"
+ *   #include "upb/port/def.inc"
  *
  *   // Code for this file.
  *   // <...>
  *
  *   // Can be omitted for .c files, required for .h.
- *   #include "upb/upb/port/undef.inc"
+ *   #include "upb/port/undef.inc"
  *
  * This file is private and must not be included by users!
  */
diff --git a/upb/upb/port/undef.inc b/upb/port/undef.inc
similarity index 100%
rename from upb/upb/port/undef.inc
rename to upb/port/undef.inc
diff --git a/upb/upb/port/vsnprintf_compat.h b/upb/port/vsnprintf_compat.h
similarity index 93%
rename from upb/upb/port/vsnprintf_compat.h
rename to upb/port/vsnprintf_compat.h
index ff65bed..1f6c644 100644
--- a/upb/upb/port/vsnprintf_compat.h
+++ b/upb/port/vsnprintf_compat.h
@@ -9,7 +9,7 @@
 #define UPB_PORT_VSNPRINTF_COMPAT_H_
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt,
                               va_list ap) {
@@ -25,6 +25,6 @@
 #endif
 }
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_PORT_VSNPRINTF_COMPAT_H_
diff --git a/upb/python/py_extension.bzl b/upb/python/py_extension.bzl
deleted file mode 100644
index aafe846..0000000
--- a/upb/python/py_extension.bzl
+++ /dev/null
@@ -1,60 +0,0 @@
-"""Macro to support py_extension """
-
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-def py_extension(name, srcs, copts, deps = [], **kwargs):
-    """Creates a C++ library to extend python
-
-    Args:
-      name: Name of the target
-      srcs: List of source files to create the target
-      copts: List of C++ compile options to use
-      deps: Libraries that the target depends on
-    """
-
-    native.cc_binary(
-        name = name + "_binary",
-        srcs = srcs,
-        copts = copts + ["-fvisibility=hidden"],
-        linkopts = selects.with_or({
-            (
-                "//upb/python/dist:osx_x86_64",
-                "//upb/python/dist:osx_aarch64",
-            ): ["-undefined", "dynamic_lookup"],
-            "//upb/python/dist:windows_x86_32": ["-static-libgcc"],
-            "//conditions:default": [],
-        }),
-        linkshared = True,
-        linkstatic = True,
-        deps = deps + select({
-            "//upb/python:limited_api_3.7": ["@python-3.7.0//:python_headers"],
-            "//upb/python:full_api_3.7_win32": ["@nuget_python_i686_3.7.0//:python_full_api"],
-            "//upb/python:full_api_3.7_win64": ["@nuget_python_x86-64_3.7.0//:python_full_api"],
-            "//upb/python:full_api_3.8_win32": ["@nuget_python_i686_3.8.0//:python_full_api"],
-            "//upb/python:full_api_3.8_win64": ["@nuget_python_x86-64_3.8.0//:python_full_api"],
-            "//upb/python:full_api_3.9_win32": ["@nuget_python_i686_3.9.0//:python_full_api"],
-            "//upb/python:full_api_3.9_win64": ["@nuget_python_x86-64_3.9.0//:python_full_api"],
-            "//upb/python:limited_api_3.10_win32": ["@nuget_python_i686_3.10.0//:python_limited_api"],
-            "//upb/python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"],
-            "//conditions:default": ["@system_python//:python_headers"],
-        }),
-        **kwargs
-    )
-
-    EXT_SUFFIX = ".abi3.so"
-    output_file = "google/_upb/" + name + EXT_SUFFIX
-
-    native.genrule(
-        name = "copy" + name,
-        srcs = [":" + name + "_binary"],
-        outs = [output_file],
-        cmd = "cp $< $@",
-        visibility = ["//upb/python:__subpackages__"],
-    )
-
-    native.py_library(
-        name = name,
-        data = [output_file],
-        imports = ["."],
-        visibility = ["//upb/python:__subpackages__"],
-    )
diff --git a/upb/upb/reflection/common.h b/upb/reflection/common.h
similarity index 96%
rename from upb/upb/reflection/common.h
rename to upb/reflection/common.h
index 0255b77..ebe3282 100644
--- a/upb/upb/reflection/common.h
+++ b/upb/reflection/common.h
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 // Declarations common to all public def types.
 
diff --git a/upb/reflection/def.h b/upb/reflection/def.h
new file mode 100644
index 0000000..ba8e839
--- /dev/null
+++ b/upb/reflection/def.h
@@ -0,0 +1,24 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2023 Google LLC.  All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file or at
+// https://developers.google.com/open-source/licenses/bsd
+
+#ifndef UPB_REFLECTION_DEF_H_
+#define UPB_REFLECTION_DEF_H_
+
+// IWYU pragma: begin_exports
+#include "upb/reflection/def_pool.h"
+#include "upb/reflection/enum_def.h"
+#include "upb/reflection/enum_value_def.h"
+#include "upb/reflection/extension_range.h"
+#include "upb/reflection/field_def.h"
+#include "upb/reflection/file_def.h"
+#include "upb/reflection/message_def.h"
+#include "upb/reflection/method_def.h"
+#include "upb/reflection/oneof_def.h"
+#include "upb/reflection/service_def.h"
+// IWYU pragma: end_exports
+
+#endif /* UPB_REFLECTION_DEF_H_ */
diff --git a/upb/upb/reflection/def.hpp b/upb/reflection/def.hpp
similarity index 98%
rename from upb/upb/reflection/def.hpp
rename to upb/reflection/def.hpp
index 8a80075..855ef3d 100644
--- a/upb/upb/reflection/def.hpp
+++ b/upb/reflection/def.hpp
@@ -13,15 +13,15 @@
 #include <string>
 #include <vector>
 
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/internal/def_pool.h"
-#include "upb/upb/reflection/internal/enum_def.h"
-#include "upb/upb/reflection/message.h"
+#include "upb/base/status.hpp"
+#include "upb/mem/arena.hpp"
+#include "upb/reflection/def.h"
+#include "upb/reflection/internal/def_pool.h"
+#include "upb/reflection/internal/enum_def.h"
+#include "upb/reflection/message.h"
 
 // Must be last
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace upb {
 
@@ -600,6 +600,6 @@
 
 }  // namespace upb
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_REFLECTION_DEF_HPP_
diff --git a/upb/upb/reflection/def_pool.c b/upb/reflection/def_pool.c
similarity index 95%
rename from upb/upb/reflection/def_pool.c
rename to upb/reflection/def_pool.c
index d055140..90d3bea 100644
--- a/upb/upb/reflection/def_pool.c
+++ b/upb/reflection/def_pool.c
@@ -5,21 +5,21 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/def_pool.h"
+#include "upb/reflection/internal/def_pool.h"
 
-#include "upb/upb/hash/int_table.h"
-#include "upb/upb/hash/str_table.h"
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/internal/enum_def.h"
-#include "upb/upb/reflection/internal/enum_value_def.h"
-#include "upb/upb/reflection/internal/field_def.h"
-#include "upb/upb/reflection/internal/file_def.h"
-#include "upb/upb/reflection/internal/message_def.h"
-#include "upb/upb/reflection/internal/service_def.h"
+#include "upb/hash/int_table.h"
+#include "upb/hash/str_table.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/enum_def.h"
+#include "upb/reflection/internal/enum_value_def.h"
+#include "upb/reflection/internal/field_def.h"
+#include "upb/reflection/internal/file_def.h"
+#include "upb/reflection/internal/message_def.h"
+#include "upb/reflection/internal/service_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_DefPool {
   upb_Arena* arena;
diff --git a/upb/upb/reflection/def_pool.h b/upb/reflection/def_pool.h
similarity index 91%
rename from upb/upb/reflection/def_pool.h
rename to upb/reflection/def_pool.h
index 66a1ffd..f21a0db 100644
--- a/upb/upb/reflection/def_pool.h
+++ b/upb/reflection/def_pool.h
@@ -5,18 +5,18 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_DEF_POOL_H_
 #define UPB_REFLECTION_DEF_POOL_H_
 
-#include "upb/upb/base/status.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/reflection/common.h"
-#include "upb/upb/reflection/def_type.h"
+#include "upb/base/status.h"
+#include "upb/base/string_view.h"
+#include "upb/reflection/common.h"
+#include "upb/reflection/def_type.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -82,6 +82,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_DEF_POOL_H_ */
diff --git a/upb/upb/reflection/def_type.c b/upb/reflection/def_type.c
similarity index 92%
rename from upb/upb/reflection/def_type.c
rename to upb/reflection/def_type.c
index 090e9b1..cd4ae15 100644
--- a/upb/upb/reflection/def_type.c
+++ b/upb/reflection/def_type.c
@@ -5,10 +5,10 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/def_type.h"
+#include "upb/reflection/def_type.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 upb_deftype_t _upb_DefType_Type(upb_value v) {
   const uintptr_t num = (uintptr_t)upb_value_getconstptr(v);
diff --git a/upb/upb/reflection/def_type.h b/upb/reflection/def_type.h
similarity index 94%
rename from upb/upb/reflection/def_type.h
rename to upb/reflection/def_type.h
index 3ca4a3b..5d56026 100644
--- a/upb/upb/reflection/def_type.h
+++ b/upb/reflection/def_type.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_DEF_TYPE_H_
 #define UPB_REFLECTION_DEF_TYPE_H_
 
-#include "upb/upb/hash/common.h"
+#include "upb/hash/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // Inside a symtab we store tagged pointers to specific def types.
 typedef enum {
@@ -56,6 +56,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_DEF_TYPE_H_ */
diff --git a/upb/upb/reflection/desc_state.c b/upb/reflection/desc_state.c
similarity index 90%
rename from upb/upb/reflection/desc_state.c
rename to upb/reflection/desc_state.c
index 4e30ea3..075314c 100644
--- a/upb/upb/reflection/desc_state.c
+++ b/upb/reflection/desc_state.c
@@ -5,10 +5,10 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/desc_state.h"
+#include "upb/reflection/internal/desc_state.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a) {
   const size_t oldbufsize = d->bufsize;
diff --git a/upb/upb/reflection/enum_def.c b/upb/reflection/enum_def.c
similarity index 93%
rename from upb/upb/reflection/enum_def.c
rename to upb/reflection/enum_def.c
index 33298bb..97fc63e 100644
--- a/upb/upb/reflection/enum_def.c
+++ b/upb/reflection/enum_def.c
@@ -5,22 +5,22 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/enum_def.h"
+#include "upb/reflection/internal/enum_def.h"
 
-#include "upb/upb/hash/int_table.h"
-#include "upb/upb/hash/str_table.h"
-#include "upb/upb/mini_descriptor/decode.h"
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/internal/desc_state.h"
-#include "upb/upb/reflection/internal/enum_reserved_range.h"
-#include "upb/upb/reflection/internal/enum_value_def.h"
-#include "upb/upb/reflection/internal/file_def.h"
-#include "upb/upb/reflection/internal/message_def.h"
-#include "upb/upb/reflection/internal/strdup2.h"
+#include "upb/hash/int_table.h"
+#include "upb/hash/str_table.h"
+#include "upb/mini_descriptor/decode.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/desc_state.h"
+#include "upb/reflection/internal/enum_reserved_range.h"
+#include "upb/reflection/internal/enum_value_def.h"
+#include "upb/reflection/internal/file_def.h"
+#include "upb/reflection/internal/message_def.h"
+#include "upb/reflection/internal/strdup2.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_EnumDef {
   const UPB_DESC(EnumOptions) * opts;
diff --git a/upb/upb/reflection/enum_def.h b/upb/reflection/enum_def.h
similarity index 90%
rename from upb/upb/reflection/enum_def.h
rename to upb/reflection/enum_def.h
index c28063b..6f406f5 100644
--- a/upb/upb/reflection/enum_def.h
+++ b/upb/reflection/enum_def.h
@@ -5,16 +5,16 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_ENUM_DEF_H_
 #define UPB_REFLECTION_ENUM_DEF_H_
 
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/reflection/common.h"
+#include "upb/base/string_view.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -55,6 +55,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_ENUM_DEF_H_ */
diff --git a/upb/upb/reflection/enum_reserved_range.c b/upb/reflection/enum_reserved_range.c
similarity index 88%
rename from upb/upb/reflection/enum_reserved_range.c
rename to upb/reflection/enum_reserved_range.c
index 1137244..f138846 100644
--- a/upb/upb/reflection/enum_reserved_range.c
+++ b/upb/reflection/enum_reserved_range.c
@@ -5,14 +5,14 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/enum_reserved_range.h"
+#include "upb/reflection/internal/enum_reserved_range.h"
 
-#include "upb/upb/reflection/enum_def.h"
-#include "upb/upb/reflection/field_def.h"
-#include "upb/upb/reflection/internal/def_builder.h"
+#include "upb/reflection/enum_def.h"
+#include "upb/reflection/field_def.h"
+#include "upb/reflection/internal/def_builder.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_EnumReservedRange {
   int32_t start;
diff --git a/upb/upb/reflection/enum_reserved_range.h b/upb/reflection/enum_reserved_range.h
similarity index 80%
rename from upb/upb/reflection/enum_reserved_range.h
rename to upb/reflection/enum_reserved_range.h
index cfd50e0..124d4c7 100644
--- a/upb/upb/reflection/enum_reserved_range.h
+++ b/upb/reflection/enum_reserved_range.h
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_H_
 #define UPB_REFLECTION_ENUM_RESERVED_RANGE_H_
 
-#include "upb/upb/reflection/common.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,6 +26,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ */
diff --git a/upb/upb/reflection/enum_value_def.c b/upb/reflection/enum_value_def.c
similarity index 93%
rename from upb/upb/reflection/enum_value_def.c
rename to upb/reflection/enum_value_def.c
index 810df2e..d06c933 100644
--- a/upb/upb/reflection/enum_value_def.c
+++ b/upb/reflection/enum_value_def.c
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/enum_value_def.h"
+#include "upb/reflection/internal/enum_value_def.h"
 
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/internal/enum_def.h"
-#include "upb/upb/reflection/internal/file_def.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/enum_def.h"
+#include "upb/reflection/internal/file_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_EnumValueDef {
   const UPB_DESC(EnumValueOptions) * opts;
diff --git a/upb/upb/reflection/enum_value_def.h b/upb/reflection/enum_value_def.h
similarity index 85%
rename from upb/upb/reflection/enum_value_def.h
rename to upb/reflection/enum_value_def.h
index a1ead81..e952328 100644
--- a/upb/upb/reflection/enum_value_def.h
+++ b/upb/reflection/enum_value_def.h
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_ENUM_VALUE_DEF_H_
 #define UPB_REFLECTION_ENUM_VALUE_DEF_H_
 
-#include "upb/upb/reflection/common.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -32,6 +32,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_H_ */
diff --git a/upb/upb/reflection/extension_range.c b/upb/reflection/extension_range.c
similarity index 90%
rename from upb/upb/reflection/extension_range.c
rename to upb/reflection/extension_range.c
index 2e5e29f..b088ba9 100644
--- a/upb/upb/reflection/extension_range.c
+++ b/upb/reflection/extension_range.c
@@ -5,14 +5,14 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/extension_range.h"
+#include "upb/reflection/internal/extension_range.h"
 
-#include "upb/upb/reflection/field_def.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/message_def.h"
+#include "upb/reflection/field_def.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/message_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_ExtensionRange {
   const UPB_DESC(ExtensionRangeOptions) * opts;
diff --git a/upb/upb/reflection/extension_range.h b/upb/reflection/extension_range.h
similarity index 82%
rename from upb/upb/reflection/extension_range.h
rename to upb/reflection/extension_range.h
index 26ca113..7c3e19f 100644
--- a/upb/upb/reflection/extension_range.h
+++ b/upb/reflection/extension_range.h
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_EXTENSION_RANGE_H_
 #define UPB_REFLECTION_EXTENSION_RANGE_H_
 
-#include "upb/upb/reflection/common.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -30,6 +30,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_EXTENSION_RANGE_H_ */
diff --git a/upb/upb/reflection/field_def.c b/upb/reflection/field_def.c
similarity index 97%
rename from upb/upb/reflection/field_def.c
rename to upb/reflection/field_def.c
index b6f4516..94bd0a5 100644
--- a/upb/upb/reflection/field_def.c
+++ b/upb/reflection/field_def.c
@@ -5,27 +5,27 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/field_def.h"
+#include "upb/reflection/internal/field_def.h"
 
 #include <ctype.h>
 #include <errno.h>
 #include <stdbool.h>
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/mini_descriptor/decode.h"
-#include "upb/upb/mini_descriptor/internal/modifiers.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/internal/desc_state.h"
-#include "upb/upb/reflection/internal/enum_def.h"
-#include "upb/upb/reflection/internal/file_def.h"
-#include "upb/upb/reflection/internal/message_def.h"
-#include "upb/upb/reflection/internal/oneof_def.h"
-#include "upb/upb/reflection/internal/strdup2.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/mini_descriptor/decode.h"
+#include "upb/mini_descriptor/internal/modifiers.h"
+#include "upb/reflection/def.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/desc_state.h"
+#include "upb/reflection/internal/enum_def.h"
+#include "upb/reflection/internal/file_def.h"
+#include "upb/reflection/internal/message_def.h"
+#include "upb/reflection/internal/oneof_def.h"
+#include "upb/reflection/internal/strdup2.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #define UPB_FIELD_TYPE_UNSPECIFIED 0
 
diff --git a/upb/upb/reflection/field_def.h b/upb/reflection/field_def.h
similarity index 93%
rename from upb/upb/reflection/field_def.h
rename to upb/reflection/field_def.h
index c610583..b3305bc 100644
--- a/upb/upb/reflection/field_def.h
+++ b/upb/reflection/field_def.h
@@ -5,16 +5,16 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_FIELD_DEF_H_
 #define UPB_REFLECTION_FIELD_DEF_H_
 
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/reflection/common.h"
+#include "upb/base/string_view.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // Maximum field number allowed for FieldDefs.
 // This is an inherent limit of the protobuf wire format.
@@ -69,6 +69,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_FIELD_DEF_H_ */
diff --git a/upb/upb/reflection/file_def.c b/upb/reflection/file_def.c
similarity index 96%
rename from upb/upb/reflection/file_def.c
rename to upb/reflection/file_def.c
index 03fc420..bd4b254 100644
--- a/upb/upb/reflection/file_def.c
+++ b/upb/reflection/file_def.c
@@ -5,18 +5,18 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/file_def.h"
+#include "upb/reflection/internal/file_def.h"
 
-#include "upb/upb/reflection/def_pool.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/internal/enum_def.h"
-#include "upb/upb/reflection/internal/field_def.h"
-#include "upb/upb/reflection/internal/message_def.h"
-#include "upb/upb/reflection/internal/service_def.h"
-#include "upb/upb/reflection/internal/strdup2.h"
+#include "upb/reflection/def_pool.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/enum_def.h"
+#include "upb/reflection/internal/field_def.h"
+#include "upb/reflection/internal/message_def.h"
+#include "upb/reflection/internal/service_def.h"
+#include "upb/reflection/internal/strdup2.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_FileDef {
   const UPB_DESC(FileOptions) * opts;
diff --git a/upb/upb/reflection/file_def.h b/upb/reflection/file_def.h
similarity index 91%
rename from upb/upb/reflection/file_def.h
rename to upb/reflection/file_def.h
index a4b9c71..f338c25 100644
--- a/upb/upb/reflection/file_def.h
+++ b/upb/reflection/file_def.h
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_FILE_DEF_H_
 #define UPB_REFLECTION_FILE_DEF_H_
 
-#include "upb/upb/reflection/common.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,6 +52,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_FILE_DEF_H_ */
diff --git a/upb/upb/reflection/internal/def_builder.c b/upb/reflection/internal/def_builder.c
similarity index 97%
rename from upb/upb/reflection/internal/def_builder.c
rename to upb/reflection/internal/def_builder.c
index 83aae89..2ab16f2 100644
--- a/upb/upb/reflection/internal/def_builder.c
+++ b/upb/reflection/internal/def_builder.c
@@ -5,17 +5,17 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/def_builder.h"
 
 #include <string.h>
 
-#include "upb/upb/reflection/def_pool.h"
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/field_def.h"
-#include "upb/upb/reflection/internal/strdup2.h"
+#include "upb/reflection/def_pool.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/field_def.h"
+#include "upb/reflection/internal/strdup2.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 /* The upb core does not generally have a concept of default instances. However
  * for descriptor options we make an exception since the max size is known and
diff --git a/upb/upb/reflection/internal/def_builder.h b/upb/reflection/internal/def_builder.h
similarity index 96%
rename from upb/upb/reflection/internal/def_builder.h
rename to upb/reflection/internal/def_builder.h
index f4c9190..5845532 100644
--- a/upb/upb/reflection/internal/def_builder.h
+++ b/upb/reflection/internal/def_builder.h
@@ -8,12 +8,12 @@
 #ifndef UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_
 #define UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_
 
-#include "upb/upb/reflection/common.h"
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/internal/def_pool.h"
+#include "upb/reflection/common.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/internal/def_pool.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // We want to copy the options verbatim into the destination options proto.
 // We use serialize+parse as our deep copy.
@@ -132,6 +132,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/def_builder_test.cc b/upb/reflection/internal/def_builder_test.cc
similarity index 95%
rename from upb/upb/reflection/internal/def_builder_test.cc
rename to upb/reflection/internal/def_builder_test.cc
index cd955b7..b624ffc 100644
--- a/upb/upb/reflection/internal/def_builder_test.cc
+++ b/upb/reflection/internal/def_builder_test.cc
@@ -5,14 +5,14 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/def_builder.h"
 
 #include <gtest/gtest.h>
 #include "absl/strings/string_view.h"
-#include "upb/upb/mem/arena.hpp"
+#include "upb/mem/arena.hpp"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct IdentTestData {
   absl::string_view text;
diff --git a/upb/upb/reflection/internal/def_pool.h b/upb/reflection/internal/def_pool.h
similarity index 92%
rename from upb/upb/reflection/internal/def_pool.h
rename to upb/reflection/internal/def_pool.h
index 7d838ed..f94d7ef 100644
--- a/upb/upb/reflection/internal/def_pool.h
+++ b/upb/reflection/internal/def_pool.h
@@ -8,11 +8,11 @@
 #ifndef UPB_REFLECTION_DEF_POOL_INTERNAL_H_
 #define UPB_REFLECTION_DEF_POOL_INTERNAL_H_
 
-#include "upb/upb/mini_descriptor/decode.h"
-#include "upb/upb/reflection/def_pool.h"
+#include "upb/mini_descriptor/decode.h"
+#include "upb/reflection/def_pool.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,6 +52,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_DEF_POOL_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/desc_state.h b/upb/reflection/internal/desc_state.h
similarity index 86%
rename from upb/upb/reflection/internal/desc_state.h
rename to upb/reflection/internal/desc_state.h
index 2ea57d7..20436d6 100644
--- a/upb/upb/reflection/internal/desc_state.h
+++ b/upb/reflection/internal/desc_state.h
@@ -8,11 +8,11 @@
 #ifndef UPB_REFLECTION_DESC_STATE_INTERNAL_H_
 #define UPB_REFLECTION_DESC_STATE_INTERNAL_H_
 
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mini_descriptor/internal/encode.h"
+#include "upb/mem/arena.h"
+#include "upb/mini_descriptor/internal/encode.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // Manages the storage for mini descriptor strings as they are being encoded.
 // TODO: Move some of this state directly into the encoder, maybe.
@@ -39,6 +39,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_DESC_STATE_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/enum_def.h b/upb/reflection/internal/enum_def.h
similarity index 89%
rename from upb/upb/reflection/internal/enum_def.h
rename to upb/reflection/internal/enum_def.h
index 94812cf..8f6b220 100644
--- a/upb/upb/reflection/internal/enum_def.h
+++ b/upb/reflection/internal/enum_def.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_ENUM_DEF_INTERNAL_H_
 #define UPB_REFLECTION_ENUM_DEF_INTERNAL_H_
 
-#include "upb/upb/reflection/enum_def.h"
+#include "upb/reflection/enum_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -31,6 +31,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/enum_reserved_range.h b/upb/reflection/internal/enum_reserved_range.h
similarity index 88%
rename from upb/upb/reflection/internal/enum_reserved_range.h
rename to upb/reflection/internal/enum_reserved_range.h
index a4a3222..fe30604 100644
--- a/upb/upb/reflection/internal/enum_reserved_range.h
+++ b/upb/reflection/internal/enum_reserved_range.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_
 #define UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_
 
-#include "upb/upb/reflection/enum_reserved_range.h"
+#include "upb/reflection/enum_reserved_range.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -30,6 +30,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/enum_value_def.h b/upb/reflection/internal/enum_value_def.h
similarity index 89%
rename from upb/upb/reflection/internal/enum_value_def.h
rename to upb/reflection/internal/enum_value_def.h
index 718c316..2484567 100644
--- a/upb/upb/reflection/internal/enum_value_def.h
+++ b/upb/reflection/internal/enum_value_def.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_
 #define UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_
 
-#include "upb/upb/reflection/enum_value_def.h"
+#include "upb/reflection/enum_value_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -32,6 +32,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/extension_range.h b/upb/reflection/internal/extension_range.h
similarity index 88%
rename from upb/upb/reflection/internal/extension_range.h
rename to upb/reflection/internal/extension_range.h
index 9cc9c45..09901b4 100644
--- a/upb/upb/reflection/internal/extension_range.h
+++ b/upb/reflection/internal/extension_range.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_
 #define UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_
 
-#include "upb/upb/reflection/extension_range.h"
+#include "upb/reflection/extension_range.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -29,6 +29,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/field_def.h b/upb/reflection/internal/field_def.h
similarity index 94%
rename from upb/upb/reflection/internal/field_def.h
rename to upb/reflection/internal/field_def.h
index 95ecbd1..838f3b6 100644
--- a/upb/upb/reflection/internal/field_def.h
+++ b/upb/reflection/internal/field_def.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_FIELD_DEF_INTERNAL_H_
 #define UPB_REFLECTION_FIELD_DEF_INTERNAL_H_
 
-#include "upb/upb/reflection/field_def.h"
+#include "upb/reflection/field_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -51,6 +51,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/file_def.h b/upb/reflection/internal/file_def.h
similarity index 90%
rename from upb/upb/reflection/internal/file_def.h
rename to upb/reflection/internal/file_def.h
index e9c167a..9afaa04 100644
--- a/upb/upb/reflection/internal/file_def.h
+++ b/upb/reflection/internal/file_def.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_FILE_DEF_INTERNAL_H_
 #define UPB_REFLECTION_FILE_DEF_INTERNAL_H_
 
-#include "upb/upb/reflection/file_def.h"
+#include "upb/reflection/file_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -32,6 +32,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_FILE_DEF_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/message_def.h b/upb/reflection/internal/message_def.h
similarity index 92%
rename from upb/upb/reflection/internal/message_def.h
rename to upb/reflection/internal/message_def.h
index e15e87b..6cc9686 100644
--- a/upb/upb/reflection/internal/message_def.h
+++ b/upb/reflection/internal/message_def.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_
 #define UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_
 
-#include "upb/upb/reflection/message_def.h"
+#include "upb/reflection/message_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -38,6 +38,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/message_reserved_range.h b/upb/reflection/internal/message_reserved_range.h
similarity index 88%
rename from upb/upb/reflection/internal/message_reserved_range.h
rename to upb/reflection/internal/message_reserved_range.h
index 374507a..88227ac 100644
--- a/upb/upb/reflection/internal/message_reserved_range.h
+++ b/upb/reflection/internal/message_reserved_range.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_
 #define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_
 
-#include "upb/upb/reflection/message_reserved_range.h"
+#include "upb/reflection/message_reserved_range.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -30,6 +30,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/method_def.h b/upb/reflection/internal/method_def.h
similarity index 88%
rename from upb/upb/reflection/internal/method_def.h
rename to upb/reflection/internal/method_def.h
index 34b274a..a7e8ef8 100644
--- a/upb/upb/reflection/internal/method_def.h
+++ b/upb/reflection/internal/method_def.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_METHOD_DEF_INTERNAL_H_
 #define UPB_REFLECTION_METHOD_DEF_INTERNAL_H_
 
-#include "upb/upb/reflection/method_def.h"
+#include "upb/reflection/method_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -28,6 +28,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/oneof_def.h b/upb/reflection/internal/oneof_def.h
similarity index 90%
rename from upb/upb/reflection/internal/oneof_def.h
rename to upb/reflection/internal/oneof_def.h
index d64d854..9cd6713 100644
--- a/upb/upb/reflection/internal/oneof_def.h
+++ b/upb/reflection/internal/oneof_def.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_
 #define UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_
 
-#include "upb/upb/reflection/oneof_def.h"
+#include "upb/reflection/oneof_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -32,6 +32,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/service_def.h b/upb/reflection/internal/service_def.h
similarity index 87%
rename from upb/upb/reflection/internal/service_def.h
rename to upb/reflection/internal/service_def.h
index b5dba70..2845b87 100644
--- a/upb/upb/reflection/internal/service_def.h
+++ b/upb/reflection/internal/service_def.h
@@ -8,10 +8,10 @@
 #ifndef UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_
 #define UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_
 
-#include "upb/upb/reflection/service_def.h"
+#include "upb/reflection/service_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -28,6 +28,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ */
diff --git a/upb/upb/reflection/internal/strdup2.c b/upb/reflection/internal/strdup2.c
similarity index 86%
rename from upb/upb/reflection/internal/strdup2.c
rename to upb/reflection/internal/strdup2.c
index e0b9ddab..2c8f76f 100644
--- a/upb/upb/reflection/internal/strdup2.c
+++ b/upb/reflection/internal/strdup2.c
@@ -5,14 +5,14 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/strdup2.h"
+#include "upb/reflection/internal/strdup2.h"
 
 #include <string.h>
 
-#include "upb/upb/mem/arena.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 char* upb_strdup2(const char* s, size_t len, upb_Arena* a) {
   size_t n;
diff --git a/upb/upb/reflection/internal/strdup2.h b/upb/reflection/internal/strdup2.h
similarity index 87%
rename from upb/upb/reflection/internal/strdup2.h
rename to upb/reflection/internal/strdup2.h
index 300ec19..0d4cadb 100644
--- a/upb/upb/reflection/internal/strdup2.h
+++ b/upb/reflection/internal/strdup2.h
@@ -10,10 +10,10 @@
 
 #include <stddef.h>
 
-#include "upb/upb/mem/arena.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -27,6 +27,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_INTERNAL_STRDUP2_H_ */
diff --git a/upb/upb/reflection/message.c b/upb/reflection/message.c
similarity index 92%
rename from upb/upb/reflection/message.c
rename to upb/reflection/message.c
index 351daa8..7ea30e6 100644
--- a/upb/upb/reflection/message.c
+++ b/upb/reflection/message.c
@@ -5,24 +5,24 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/message.h"
+#include "upb/reflection/message.h"
 
 #include <string.h>
 
-#include "upb/upb/collections/map.h"
-#include "upb/upb/hash/common.h"
-#include "upb/upb/message/accessors.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/def_pool.h"
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/internal/field_def.h"
-#include "upb/upb/reflection/message_def.h"
-#include "upb/upb/reflection/oneof_def.h"
+#include "upb/collections/map.h"
+#include "upb/hash/common.h"
+#include "upb/message/accessors.h"
+#include "upb/message/message.h"
+#include "upb/mini_table/field.h"
+#include "upb/reflection/def.h"
+#include "upb/reflection/def_pool.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/internal/field_def.h"
+#include "upb/reflection/message_def.h"
+#include "upb/reflection/oneof_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 bool upb_Message_HasFieldByDef(const upb_Message* msg, const upb_FieldDef* f) {
   UPB_ASSERT(upb_FieldDef_HasPresence(f));
diff --git a/upb/upb/reflection/message.h b/upb/reflection/message.h
similarity index 91%
rename from upb/upb/reflection/message.h
rename to upb/reflection/message.h
index 0f9466c..01a0840 100644
--- a/upb/upb/reflection/message.h
+++ b/upb/reflection/message.h
@@ -10,14 +10,14 @@
 
 #include <stddef.h>
 
-#include "upb/upb/collections/map.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/types.h"
-#include "upb/upb/message/value.h"  // IWYU pragma: export
-#include "upb/upb/reflection/common.h"
+#include "upb/collections/map.h"
+#include "upb/mem/arena.h"
+#include "upb/message/types.h"
+#include "upb/message/value.h"  // IWYU pragma: export
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -84,6 +84,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_MESSAGE_H_ */
diff --git a/upb/upb/reflection/message.hpp b/upb/reflection/message.hpp
similarity index 91%
rename from upb/upb/reflection/message.hpp
rename to upb/reflection/message.hpp
index fc3effe..6d5bc98 100644
--- a/upb/upb/reflection/message.hpp
+++ b/upb/reflection/message.hpp
@@ -8,7 +8,7 @@
 #ifndef UPB_REFLECTION_MESSAGE_HPP_
 #define UPB_REFLECTION_MESSAGE_HPP_
 
-#include "upb/upb/reflection/message.h"
+#include "upb/reflection/message.h"
 
 namespace upb {
 
diff --git a/upb/upb/reflection/message_def.c b/upb/reflection/message_def.c
similarity index 96%
rename from upb/upb/reflection/message_def.c
rename to upb/reflection/message_def.c
index d0f3f94..59b743b 100644
--- a/upb/upb/reflection/message_def.c
+++ b/upb/reflection/message_def.c
@@ -5,27 +5,27 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/message_def.h"
+#include "upb/reflection/internal/message_def.h"
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/hash/int_table.h"
-#include "upb/upb/hash/str_table.h"
-#include "upb/upb/mini_descriptor/decode.h"
-#include "upb/upb/mini_descriptor/internal/modifiers.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/internal/desc_state.h"
-#include "upb/upb/reflection/internal/enum_def.h"
-#include "upb/upb/reflection/internal/extension_range.h"
-#include "upb/upb/reflection/internal/field_def.h"
-#include "upb/upb/reflection/internal/file_def.h"
-#include "upb/upb/reflection/internal/message_reserved_range.h"
-#include "upb/upb/reflection/internal/oneof_def.h"
-#include "upb/upb/reflection/internal/strdup2.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/hash/int_table.h"
+#include "upb/hash/str_table.h"
+#include "upb/mini_descriptor/decode.h"
+#include "upb/mini_descriptor/internal/modifiers.h"
+#include "upb/reflection/def.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/desc_state.h"
+#include "upb/reflection/internal/enum_def.h"
+#include "upb/reflection/internal/extension_range.h"
+#include "upb/reflection/internal/field_def.h"
+#include "upb/reflection/internal/file_def.h"
+#include "upb/reflection/internal/message_reserved_range.h"
+#include "upb/reflection/internal/oneof_def.h"
+#include "upb/reflection/internal/strdup2.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_MessageDef {
   const UPB_DESC(MessageOptions) * opts;
diff --git a/upb/upb/reflection/message_def.h b/upb/reflection/message_def.h
similarity index 96%
rename from upb/upb/reflection/message_def.h
rename to upb/reflection/message_def.h
index b8fef3b..a5c85ef 100644
--- a/upb/upb/reflection/message_def.h
+++ b/upb/reflection/message_def.h
@@ -5,16 +5,16 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_MESSAGE_DEF_H_
 #define UPB_REFLECTION_MESSAGE_DEF_H_
 
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/reflection/common.h"
+#include "upb/base/string_view.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // Well-known field tag numbers for map-entry messages.
 #define kUpb_MapEntry_KeyFieldNumber 1
@@ -151,6 +151,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_MESSAGE_DEF_H_ */
diff --git a/upb/upb/reflection/message_reserved_range.c b/upb/reflection/message_reserved_range.c
similarity index 86%
rename from upb/upb/reflection/message_reserved_range.c
rename to upb/reflection/message_reserved_range.c
index bce7605..bb274e1 100644
--- a/upb/upb/reflection/message_reserved_range.c
+++ b/upb/reflection/message_reserved_range.c
@@ -5,14 +5,14 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/enum_def.h"
-#include "upb/upb/reflection/field_def.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/internal/extension_range.h"
-#include "upb/upb/reflection/message_def.h"
+#include "upb/reflection/enum_def.h"
+#include "upb/reflection/field_def.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/extension_range.h"
+#include "upb/reflection/message_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_MessageReservedRange {
   int32_t start;
diff --git a/upb/upb/reflection/message_reserved_range.h b/upb/reflection/message_reserved_range.h
similarity index 80%
rename from upb/upb/reflection/message_reserved_range.h
rename to upb/reflection/message_reserved_range.h
index dcefaf5..9854f52 100644
--- a/upb/upb/reflection/message_reserved_range.h
+++ b/upb/reflection/message_reserved_range.h
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_
 #define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_
 
-#include "upb/upb/reflection/common.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,6 +26,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ */
diff --git a/upb/upb/reflection/method_def.c b/upb/reflection/method_def.c
similarity index 92%
rename from upb/upb/reflection/method_def.c
rename to upb/reflection/method_def.c
index 8d45c06..049ef4a 100644
--- a/upb/upb/reflection/method_def.c
+++ b/upb/reflection/method_def.c
@@ -5,14 +5,14 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/method_def.h"
+#include "upb/reflection/internal/method_def.h"
 
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/service_def.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/service_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_MethodDef {
   const UPB_DESC(MethodOptions) * opts;
diff --git a/upb/upb/reflection/method_def.h b/upb/reflection/method_def.h
similarity index 87%
rename from upb/upb/reflection/method_def.h
rename to upb/reflection/method_def.h
index bf3e6b5..64b88a6 100644
--- a/upb/upb/reflection/method_def.h
+++ b/upb/reflection/method_def.h
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_METHOD_DEF_H_
 #define UPB_REFLECTION_METHOD_DEF_H_
 
-#include "upb/upb/reflection/common.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -34,6 +34,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_METHOD_DEF_H_ */
diff --git a/upb/upb/reflection/oneof_def.c b/upb/reflection/oneof_def.c
similarity index 94%
rename from upb/upb/reflection/oneof_def.c
rename to upb/reflection/oneof_def.c
index e989248..869ca16 100644
--- a/upb/upb/reflection/oneof_def.c
+++ b/upb/reflection/oneof_def.c
@@ -5,21 +5,21 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/oneof_def.h"
+#include "upb/reflection/internal/oneof_def.h"
 
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "upb/upb/hash/int_table.h"
-#include "upb/upb/hash/str_table.h"
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/internal/field_def.h"
-#include "upb/upb/reflection/internal/message_def.h"
+#include "upb/hash/int_table.h"
+#include "upb/hash/str_table.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/field_def.h"
+#include "upb/reflection/internal/message_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_OneofDef {
   const UPB_DESC(OneofOptions) * opts;
diff --git a/upb/upb/reflection/oneof_def.h b/upb/reflection/oneof_def.h
similarity index 90%
rename from upb/upb/reflection/oneof_def.h
rename to upb/reflection/oneof_def.h
index 0143c6d..38c7a70 100644
--- a/upb/upb/reflection/oneof_def.h
+++ b/upb/reflection/oneof_def.h
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_ONEOF_DEF_H_
 #define UPB_REFLECTION_ONEOF_DEF_H_
 
-#include "upb/upb/reflection/common.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -42,6 +42,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_ONEOF_DEF_H_ */
diff --git a/upb/upb/reflection/service_def.c b/upb/reflection/service_def.c
similarity index 91%
rename from upb/upb/reflection/service_def.c
rename to upb/reflection/service_def.c
index c948870..7a0cbc7 100644
--- a/upb/upb/reflection/service_def.c
+++ b/upb/reflection/service_def.c
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/reflection/internal/service_def.h"
+#include "upb/reflection/internal/service_def.h"
 
-#include "upb/upb/reflection/def_type.h"
-#include "upb/upb/reflection/internal/def_builder.h"
-#include "upb/upb/reflection/internal/file_def.h"
-#include "upb/upb/reflection/internal/method_def.h"
+#include "upb/reflection/def_type.h"
+#include "upb/reflection/internal/def_builder.h"
+#include "upb/reflection/internal/file_def.h"
+#include "upb/reflection/internal/method_def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_ServiceDef {
   const UPB_DESC(ServiceOptions) * opts;
diff --git a/upb/upb/reflection/service_def.h b/upb/reflection/service_def.h
similarity index 87%
rename from upb/upb/reflection/service_def.h
rename to upb/reflection/service_def.h
index 63b63d4..98cd993 100644
--- a/upb/upb/reflection/service_def.h
+++ b/upb/reflection/service_def.h
@@ -5,15 +5,15 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-// IWYU pragma: private, include "upb/upb/reflection/def.h"
+// IWYU pragma: private, include "upb/reflection/def.h"
 
 #ifndef UPB_REFLECTION_SERVICE_DEF_H_
 #define UPB_REFLECTION_SERVICE_DEF_H_
 
-#include "upb/upb/reflection/common.h"
+#include "upb/reflection/common.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -35,6 +35,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_REFLECTION_SERVICE_DEF_H_ */
diff --git a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c b/upb/reflection/stage0/google/protobuf/descriptor.upb.c
similarity index 99%
rename from upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c
rename to upb/reflection/stage0/google/protobuf/descriptor.upb.c
index 2f2054b..0db5b60 100644
--- a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c
+++ b/upb/reflection/stage0/google/protobuf/descriptor.upb.c
@@ -1,5 +1,5 @@
 #include <stddef.h>
-#include "upb/upb/generated_code_support.h"
+#include "upb/generated_code_support.h"
 #include "google/protobuf/descriptor.upb.h"
 
 static upb_Arena* upb_BootstrapArena() {
diff --git a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h b/upb/reflection/stage0/google/protobuf/descriptor.upb.h
similarity index 99%
rename from upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h
rename to upb/reflection/stage0/google/protobuf/descriptor.upb.h
index c5870d0..192032c 100644
--- a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h
+++ b/upb/reflection/stage0/google/protobuf/descriptor.upb.h
@@ -9,10 +9,10 @@
 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
 #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
 
-#include "upb/upb/generated_code_support.h"
+#include "upb/generated_code_support.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -6439,6 +6439,6 @@
 }  /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */
diff --git a/upb/upb/test/BUILD b/upb/test/BUILD
similarity index 98%
rename from upb/upb/test/BUILD
rename to upb/test/BUILD
index 59afb4e..824bf7c 100644
--- a/upb/upb/test/BUILD
+++ b/upb/test/BUILD
@@ -6,11 +6,11 @@
 # https://developers.google.com/open-source/licenses/bsd
 
 load(
-    "//upb/bazel:build_defs.bzl",
+    "//bazel:build_defs.bzl",
     "UPB_DEFAULT_CPPOPTS",
 )
 load(
-    "//upb/bazel:upb_proto_library.bzl",
+    "//bazel:upb_proto_library.bzl",
     "upb_proto_library",
     "upb_proto_reflection_library",
 )
@@ -136,8 +136,8 @@
     deps = [
         ":proto3_test_upb_proto",
         ":proto3_test_upb_proto_reflection",
-        "//upb:reflection",
         "@com_google_googletest//:gtest_main",
+        "//upb:reflection",
     ],
 )
 
@@ -150,10 +150,10 @@
         ":test_cpp_upb_proto_reflection",
         ":timestamp_upb_proto",
         ":timestamp_upb_proto_reflection",
+        "@com_google_googletest//:gtest_main",
         "//upb:json",
         "//upb:port",
         "//upb:reflection",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -167,11 +167,11 @@
         ":test_messages_proto2_upb_proto",
         ":test_messages_proto3_upb_proto",
         ":test_upb_proto",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:collections",
         "//upb:mem",
         "//upb:port",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -185,10 +185,10 @@
         ":test_messages_proto2_upb_proto",
         ":test_messages_proto3_upb_proto",
         ":test_upb_proto",
+        "@com_google_googletest//:gtest_main",
         "//upb:mini_table",
         "//upb:mini_table_internal",
         "//upb:port",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
diff --git a/upb/upb/test/empty.proto b/upb/test/empty.proto
similarity index 100%
rename from upb/upb/test/empty.proto
rename to upb/test/empty.proto
diff --git a/upb/upb/test/fuzz_util.cc b/upb/test/fuzz_util.cc
similarity index 94%
rename from upb/upb/test/fuzz_util.cc
rename to upb/test/fuzz_util.cc
index 7f92db8..714fcac 100644
--- a/upb/upb/test/fuzz_util.cc
+++ b/upb/test/fuzz_util.cc
@@ -5,16 +5,16 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/test/fuzz_util.h"
+#include "upb/test/fuzz_util.h"
 
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/message/message.h"
-#include "upb/upb/mini_descriptor/decode.h"
-#include "upb/upb/mini_table/extension.h"
-#include "upb/upb/mini_table/extension_registry.h"
+#include "upb/base/status.hpp"
+#include "upb/message/message.h"
+#include "upb/mini_descriptor/decode.h"
+#include "upb/mini_table/extension.h"
+#include "upb/mini_table/extension_registry.h"
 
 // Must be last
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace upb {
 namespace fuzz {
diff --git a/upb/upb/test/fuzz_util.h b/upb/test/fuzz_util.h
similarity index 95%
rename from upb/upb/test/fuzz_util.h
rename to upb/test/fuzz_util.h
index 414e018..72bf31e 100644
--- a/upb/upb/test/fuzz_util.h
+++ b/upb/test/fuzz_util.h
@@ -11,8 +11,8 @@
 #include <string>
 #include <vector>
 
-#include "upb/upb/mini_table/extension_registry.h"
-// #include "upb/upb/mini_table/types.h"
+#include "upb/mini_table/extension_registry.h"
+// #include "upb/mini_table/types.h"
 
 namespace upb {
 namespace fuzz {
diff --git a/upb/upb/test/parse_text_proto.h b/upb/test/parse_text_proto.h
similarity index 100%
rename from upb/upb/test/parse_text_proto.h
rename to upb/test/parse_text_proto.h
diff --git a/upb/upb/test/proto3_test.cc b/upb/test/proto3_test.cc
similarity index 79%
rename from upb/upb/test/proto3_test.cc
rename to upb/test/proto3_test.cc
index c76864e..d1af699 100644
--- a/upb/upb/test/proto3_test.cc
+++ b/upb/test/proto3_test.cc
@@ -6,9 +6,9 @@
 // https://developers.google.com/open-source/licenses/bsd
 
 #include <gtest/gtest.h>
-#include "upb/upb/reflection/def.hpp"
-#include "upb/upb/test/proto3_test.upb.h"
-#include "upb/upb/test/proto3_test.upbdefs.h"
+#include "upb/reflection/def.hpp"
+#include "upb/test/proto3_test.upb.h"
+#include "upb/test/proto3_test.upbdefs.h"
 
 TEST(Proto3Test, SyntheticOneofExtension) {
   upb::DefPool defpool;
diff --git a/upb/upb/test/proto3_test.proto b/upb/test/proto3_test.proto
similarity index 100%
rename from upb/upb/test/proto3_test.proto
rename to upb/test/proto3_test.proto
diff --git a/upb/upb/test/test.proto b/upb/test/test.proto
similarity index 100%
rename from upb/upb/test/test.proto
rename to upb/test/test.proto
diff --git a/upb/upb/test/test_cpp.cc b/upb/test/test_cpp.cc
similarity index 92%
rename from upb/upb/test/test_cpp.cc
rename to upb/test/test_cpp.cc
index bfb436a..bd917c1 100644
--- a/upb/upb/test/test_cpp.cc
+++ b/upb/test/test_cpp.cc
@@ -17,15 +17,15 @@
 #include "google/protobuf/timestamp.upb.h"
 #include "google/protobuf/timestamp.upbdefs.h"
 #include <gtest/gtest.h>
-#include "upb/upb/json/decode.h"
-#include "upb/upb/json/encode.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/def.hpp"
-#include "upb/upb/test/test_cpp.upb.h"
-#include "upb/upb/test/test_cpp.upbdefs.h"
+#include "upb/json/decode.h"
+#include "upb/json/encode.h"
+#include "upb/reflection/def.h"
+#include "upb/reflection/def.hpp"
+#include "upb/test/test_cpp.upb.h"
+#include "upb/test/test_cpp.upbdefs.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 TEST(Cpp, Iteration) {
   upb::DefPool defpool;
diff --git a/upb/upb/test/test_cpp.proto b/upb/test/test_cpp.proto
similarity index 100%
rename from upb/upb/test/test_cpp.proto
rename to upb/test/test_cpp.proto
diff --git a/upb/upb/test/test_generated_code.cc b/upb/test/test_generated_code.cc
similarity index 99%
rename from upb/upb/test/test_generated_code.cc
rename to upb/test/test_generated_code.cc
index b5bee71..e8f33d5 100644
--- a/upb/upb/test/test_generated_code.cc
+++ b/upb/test/test_generated_code.cc
@@ -16,14 +16,14 @@
 #include <gtest/gtest.h>
 #include "google/protobuf/test_messages_proto2.upb.h"
 #include "google/protobuf/test_messages_proto3.upb.h"
-#include "upb/upb/base/status.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/collections/array.h"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/test/test.upb.h"
+#include "upb/base/status.h"
+#include "upb/base/string_view.h"
+#include "upb/collections/array.h"
+#include "upb/mem/arena.hpp"
+#include "upb/test/test.upb.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #if !defined(MIN)
 #define MIN(x, y) ((x) < (y) ? (x) : (y))
diff --git a/upb/upb/test/test_import_empty_srcs.cc b/upb/test/test_import_empty_srcs.cc
similarity index 89%
rename from upb/upb/test/test_import_empty_srcs.cc
rename to upb/test/test_import_empty_srcs.cc
index 1624bcd..cefa522 100644
--- a/upb/upb/test/test_import_empty_srcs.cc
+++ b/upb/test/test_import_empty_srcs.cc
@@ -6,7 +6,7 @@
 // https://developers.google.com/open-source/licenses/bsd
 
 #include <gtest/gtest.h>
-#include "upb/upb/test/test_import_empty_srcs.upb.h"
+#include "upb/test/test_import_empty_srcs.upb.h"
 
 TEST(Test, Reexport) {
   // This test really just ensures that compilation succeeds.
diff --git a/upb/upb/test/test_import_empty_srcs.proto b/upb/test/test_import_empty_srcs.proto
similarity index 85%
rename from upb/upb/test/test_import_empty_srcs.proto
rename to upb/test/test_import_empty_srcs.proto
index de5c6a7..eca7d93 100644
--- a/upb/upb/test/test_import_empty_srcs.proto
+++ b/upb/test/test_import_empty_srcs.proto
@@ -9,8 +9,8 @@
 
 package upb_test;
 
-import "upb/upb/test/test.proto";
-import "upb/upb/test/test_cpp.proto";
+import "upb/test/test.proto";
+import "upb/test/test_cpp.proto";
 
 message ContainsImported {
   optional MessageName message_name = 1;
diff --git a/upb/upb/test/test_mini_table_oneof.cc b/upb/test/test_mini_table_oneof.cc
similarity index 91%
rename from upb/upb/test/test_mini_table_oneof.cc
rename to upb/test/test_mini_table_oneof.cc
index 88eec15..434e5fb 100644
--- a/upb/upb/test/test_mini_table_oneof.cc
+++ b/upb/test/test_mini_table_oneof.cc
@@ -8,12 +8,12 @@
 #include <gtest/gtest.h>
 #include "google/protobuf/test_messages_proto2.upb.h"
 #include "google/protobuf/test_messages_proto3.upb.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/message.h"
-#include "upb/upb/test/test.upb.h"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/message.h"
+#include "upb/test/test.upb.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 TEST(MiniTableOneofTest, OneOfIteratorProto2) {
   constexpr int oneof_first_field_number = 111;
diff --git a/upb/upb/text/BUILD b/upb/text/BUILD
similarity index 90%
rename from upb/upb/text/BUILD
rename to upb/text/BUILD
index 81ce078..cca2b7e 100644
--- a/upb/upb/text/BUILD
+++ b/upb/text/BUILD
@@ -5,7 +5,7 @@
 # license that can be found in the LICENSE file or at
 # https://developers.google.com/open-source/licenses/bsd
 
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 
 cc_library(
     name = "text",
@@ -41,7 +41,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/text/encode.c b/upb/text/encode.c
similarity index 96%
rename from upb/upb/text/encode.c
rename to upb/text/encode.c
index f04dea1..d3e0b61 100644
--- a/upb/upb/text/encode.c
+++ b/upb/text/encode.c
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/text/encode.h"
+#include "upb/text/encode.h"
 
 #include <ctype.h>
 #include <float.h>
@@ -13,17 +13,17 @@
 #include <stdarg.h>
 #include <string.h>
 
-#include "upb/upb/collections/internal/map_sorter.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/lex/round_trip.h"
-#include "upb/upb/port/vsnprintf_compat.h"
-#include "upb/upb/reflection/message.h"
-#include "upb/upb/wire/eps_copy_input_stream.h"
-#include "upb/upb/wire/reader.h"
-#include "upb/upb/wire/types.h"
+#include "upb/collections/internal/map_sorter.h"
+#include "upb/collections/map.h"
+#include "upb/lex/round_trip.h"
+#include "upb/port/vsnprintf_compat.h"
+#include "upb/reflection/message.h"
+#include "upb/wire/eps_copy_input_stream.h"
+#include "upb/wire/reader.h"
+#include "upb/wire/types.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct {
   char *buf, *ptr, *end;
diff --git a/upb/upb/text/encode.h b/upb/text/encode.h
similarity index 92%
rename from upb/upb/text/encode.h
rename to upb/text/encode.h
index cd219da..9374dc3 100644
--- a/upb/upb/text/encode.h
+++ b/upb/text/encode.h
@@ -8,10 +8,10 @@
 #ifndef UPB_TEXT_ENCODE_H_
 #define UPB_TEXT_ENCODE_H_
 
-#include "upb/upb/reflection/def.h"
+#include "upb/reflection/def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -44,6 +44,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_TEXT_ENCODE_H_ */
diff --git a/upb/upb/upb.hpp b/upb/upb.hpp
similarity index 86%
rename from upb/upb/upb.hpp
rename to upb/upb.hpp
index bbdcfa2..9276c16 100644
--- a/upb/upb/upb.hpp
+++ b/upb/upb.hpp
@@ -11,8 +11,8 @@
 #define UPB_HPP_
 
 // IWYU pragma: begin_exports
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/mem/arena.hpp"
+#include "upb/base/status.hpp"
+#include "upb/mem/arena.hpp"
 // IWYU pragma: end_exports
 
 #endif  // UPB_HPP_
diff --git a/upb/upb/generated_code_support.h b/upb/upb/generated_code_support.h
deleted file mode 100644
index ab47ad7..0000000
--- a/upb/upb/generated_code_support.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2023 Google LLC.  All rights reserved.
-//
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file or at
-// https://developers.google.com/open-source/licenses/bsd
-
-#ifndef UPB_GENERATED_CODE_SUPPORT_H_
-#define UPB_GENERATED_CODE_SUPPORT_H_
-
-// IWYU pragma: begin_exports
-#include "upb/upb/collections/array.h"
-#include "upb/upb/collections/internal/array.h"
-#include "upb/upb/collections/map_gencode_util.h"
-#include "upb/upb/message/accessors.h"
-#include "upb/upb/message/internal/accessors.h"
-#include "upb/upb/message/internal/extension.h"
-#include "upb/upb/message/internal/message.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/mini_descriptor/decode.h"
-#include "upb/upb/mini_table/enum.h"
-#include "upb/upb/mini_table/extension.h"
-#include "upb/upb/mini_table/extension_registry.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/file.h"
-#include "upb/upb/mini_table/message.h"
-#include "upb/upb/mini_table/sub.h"
-#include "upb/upb/wire/decode.h"
-#include "upb/upb/wire/decode_fast.h"
-#include "upb/upb/wire/encode.h"
-// IWYU pragma: end_exports
-
-#endif  // UPB_GENERATED_CODE_SUPPORT_H_
diff --git a/upb/upb/reflection/def.h b/upb/upb/reflection/def.h
deleted file mode 100644
index ba40828..0000000
--- a/upb/upb/reflection/def.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2023 Google LLC.  All rights reserved.
-//
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file or at
-// https://developers.google.com/open-source/licenses/bsd
-
-#ifndef UPB_REFLECTION_DEF_H_
-#define UPB_REFLECTION_DEF_H_
-
-// IWYU pragma: begin_exports
-#include "upb/upb/reflection/def_pool.h"
-#include "upb/upb/reflection/enum_def.h"
-#include "upb/upb/reflection/enum_value_def.h"
-#include "upb/upb/reflection/extension_range.h"
-#include "upb/upb/reflection/field_def.h"
-#include "upb/upb/reflection/file_def.h"
-#include "upb/upb/reflection/message_def.h"
-#include "upb/upb/reflection/method_def.h"
-#include "upb/upb/reflection/oneof_def.h"
-#include "upb/upb/reflection/service_def.h"
-// IWYU pragma: end_exports
-
-#endif /* UPB_REFLECTION_DEF_H_ */
diff --git a/upb/upb/upb_so.c b/upb/upb_so.c
similarity index 62%
rename from upb/upb/upb_so.c
rename to upb/upb_so.c
index 36ec6b4..23d2530 100644
--- a/upb/upb/upb_so.c
+++ b/upb/upb_so.c
@@ -7,8 +7,8 @@
 
 // These headers form a spanning tree for the upb defs needed by FFI layers.
 
-#include "upb/upb/collections/array_split64.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/message/accessors_split64.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/mini_descriptor/decode.h"
+#include "upb/collections/array_split64.h"
+#include "upb/collections/map.h"
+#include "upb/message/accessors_split64.h"
+#include "upb/message/message.h"
+#include "upb/mini_descriptor/decode.h"
diff --git a/upb/upb/util/BUILD b/upb/util/BUILD
similarity index 96%
rename from upb/upb/util/BUILD
rename to upb/util/BUILD
index 46b8521..40bf564 100644
--- a/upb/upb/util/BUILD
+++ b/upb/util/BUILD
@@ -1,5 +1,5 @@
 load(
-    "//upb/bazel:upb_proto_library.bzl",
+    "//bazel:upb_proto_library.bzl",
     "upb_proto_library",
     "upb_proto_reflection_library",
 )
@@ -67,12 +67,12 @@
         ":def_to_proto_test_upb_proto",
         ":def_to_proto_test_upb_proto_reflection",
         "//:protobuf",
+        "@com_google_googletest//:gtest_main",
         "//upb:descriptor_upb_proto_reflection",
         "//upb:mem",
         "//upb:reflection",
-        "//upb/upb/test:parse_text_proto",
+        "//upb/test:parse_text_proto",
         "@com_google_absl//absl/strings",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -83,8 +83,8 @@
 #     tags = ["clang_only"],
 #     deps = [
 #         ":def_to_proto_test_lib",
-#         "//testing/fuzzing:fuzztest",
 #         "@com_google_googletest//:gtest_main",
+#         "//testing/fuzzing:fuzztest",
 #     ],
 # )
 # end:google_only
@@ -127,12 +127,12 @@
         ":required_fields",
         ":required_fields_test_upb_proto",
         ":required_fields_test_upb_proto_reflection",
+        "@com_google_googletest//:gtest_main",
         "//upb:base",
         "//upb:json",
         "//upb:mem",
         "//upb:reflection",
         "@com_google_absl//absl/strings",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -157,10 +157,10 @@
     srcs = ["compare_test.cc"],
     deps = [
         ":compare",
+        "@com_google_googletest//:gtest_main",
         "//upb:wire_internal",
         "//upb:wire_types",
         "@com_google_absl//absl/strings",
-        "@com_google_googletest//:gtest_main",
     ],
 )
 
@@ -175,6 +175,6 @@
         "required_fields.c",
         "required_fields.h",
     ],
-    visibility = ["//upb/python/dist:__pkg__"],
+    visibility = ["//python/dist:__pkg__"],
 )
 # end:github_only
diff --git a/upb/upb/util/README.md b/upb/util/README.md
similarity index 100%
rename from upb/upb/util/README.md
rename to upb/util/README.md
diff --git a/upb/upb/util/compare.c b/upb/util/compare.c
similarity index 97%
rename from upb/upb/util/compare.c
rename to upb/util/compare.c
index 9cd5608..2a774d0 100644
--- a/upb/upb/util/compare.c
+++ b/upb/util/compare.c
@@ -5,16 +5,16 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/util/compare.h"
+#include "upb/util/compare.h"
 
 #include <stdlib.h>
 
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/wire/eps_copy_input_stream.h"
-#include "upb/upb/wire/reader.h"
-#include "upb/upb/wire/types.h"
+#include "upb/base/string_view.h"
+#include "upb/wire/eps_copy_input_stream.h"
+#include "upb/wire/reader.h"
+#include "upb/wire/types.h"
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 struct upb_UnknownFields;
 typedef struct upb_UnknownFields upb_UnknownFields;
diff --git a/upb/upb/util/compare.h b/upb/util/compare.h
similarity index 100%
rename from upb/upb/util/compare.h
rename to upb/util/compare.h
diff --git a/upb/upb/util/compare_test.cc b/upb/util/compare_test.cc
similarity index 98%
rename from upb/upb/util/compare_test.cc
rename to upb/util/compare_test.cc
index bf226fb..f9b34da 100644
--- a/upb/upb/util/compare_test.cc
+++ b/upb/util/compare_test.cc
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/util/compare.h"
+#include "upb/util/compare.h"
 
 #include <stdint.h>
 
@@ -15,8 +15,8 @@
 #include <vector>
 
 #include <gtest/gtest.h>
-#include "upb/upb/wire/internal/swap.h"
-#include "upb/upb/wire/types.h"
+#include "upb/wire/internal/swap.h"
+#include "upb/wire/types.h"
 
 struct UnknownField;
 
diff --git a/upb/upb/util/def_to_proto.c b/upb/util/def_to_proto.c
similarity index 98%
rename from upb/upb/util/def_to_proto.c
rename to upb/util/def_to_proto.c
index cf3b853..29331d5 100644
--- a/upb/upb/util/def_to_proto.c
+++ b/upb/util/def_to_proto.c
@@ -5,21 +5,21 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/util/def_to_proto.h"
+#include "upb/util/def_to_proto.h"
 
 #include <inttypes.h>
 #include <math.h>
 
-#include "upb/upb/port/vsnprintf_compat.h"
-#include "upb/upb/reflection/enum_reserved_range.h"
-#include "upb/upb/reflection/extension_range.h"
-#include "upb/upb/reflection/internal/field_def.h"
-#include "upb/upb/reflection/internal/file_def.h"
-#include "upb/upb/reflection/message.h"
-#include "upb/upb/reflection/message_reserved_range.h"
+#include "upb/port/vsnprintf_compat.h"
+#include "upb/reflection/enum_reserved_range.h"
+#include "upb/reflection/extension_range.h"
+#include "upb/reflection/internal/field_def.h"
+#include "upb/reflection/internal/file_def.h"
+#include "upb/reflection/message.h"
+#include "upb/reflection/message_reserved_range.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 typedef struct {
   upb_Arena* arena;
diff --git a/upb/upb/util/def_to_proto.h b/upb/util/def_to_proto.h
similarity index 97%
rename from upb/upb/util/def_to_proto.h
rename to upb/util/def_to_proto.h
index 53f2d16..a8dd70b 100644
--- a/upb/upb/util/def_to_proto.h
+++ b/upb/util/def_to_proto.h
@@ -8,7 +8,7 @@
 #ifndef UPB_UTIL_DEF_TO_PROTO_H_
 #define UPB_UTIL_DEF_TO_PROTO_H_
 
-#include "upb/upb/reflection/def.h"
+#include "upb/reflection/def.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/upb/upb/util/def_to_proto_fuzz_test.cc b/upb/util/def_to_proto_fuzz_test.cc
similarity index 96%
rename from upb/upb/util/def_to_proto_fuzz_test.cc
rename to upb/util/def_to_proto_fuzz_test.cc
index 01ae0ab..e2ba440 100644
--- a/upb/upb/util/def_to_proto_fuzz_test.cc
+++ b/upb/util/def_to_proto_fuzz_test.cc
@@ -10,7 +10,7 @@
 #include "google/protobuf/descriptor.pb.h"
 #include <gtest/gtest.h>
 #include "testing/fuzzing/fuzztest.h"
-#include "upb/upb/util/def_to_proto_test.h"
+#include "upb/util/def_to_proto_test.h"
 
 namespace upb_test {
 
diff --git a/upb/upb/util/def_to_proto_public_import_test.proto b/upb/util/def_to_proto_public_import_test.proto
similarity index 100%
rename from upb/upb/util/def_to_proto_public_import_test.proto
rename to upb/util/def_to_proto_public_import_test.proto
diff --git a/upb/upb/util/def_to_proto_regular_import_test.proto b/upb/util/def_to_proto_regular_import_test.proto
similarity index 100%
rename from upb/upb/util/def_to_proto_regular_import_test.proto
rename to upb/util/def_to_proto_regular_import_test.proto
diff --git a/upb/upb/util/def_to_proto_test.cc b/upb/util/def_to_proto_test.cc
similarity index 94%
rename from upb/upb/util/def_to_proto_test.cc
rename to upb/util/def_to_proto_test.cc
index 2c19bfb..cad9abf 100644
--- a/upb/upb/util/def_to_proto_test.cc
+++ b/upb/util/def_to_proto_test.cc
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/util/def_to_proto.h"
+#include "upb/util/def_to_proto.h"
 
 #include <memory>
 #include <string>
@@ -16,11 +16,11 @@
 #include <gtest/gtest.h>
 #include "google/protobuf/dynamic_message.h"
 #include "google/protobuf/util/message_differencer.h"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/reflection/def.hpp"
-#include "upb/upb/test/parse_text_proto.h"
-#include "upb/upb/util/def_to_proto_test.h"
-#include "upb/upb/util/def_to_proto_test.upbdefs.h"
+#include "upb/mem/arena.hpp"
+#include "upb/reflection/def.hpp"
+#include "upb/test/parse_text_proto.h"
+#include "upb/util/def_to_proto_test.h"
+#include "upb/util/def_to_proto_test.upbdefs.h"
 
 namespace upb_test {
 
@@ -106,7 +106,7 @@
   upb::Arena arena;
   upb::DefPool defpool;
   upb_StringView test_file_desc =
-      upb_upb_util_def_to_proto_test_proto_upbdefinit.descriptor;
+      upb_util_def_to_proto_test_proto_upbdefinit.descriptor;
   const auto* file_desc = google_protobuf_FileDescriptorProto_parse(
       test_file_desc.data, test_file_desc.size, arena.ptr());
 
@@ -120,15 +120,15 @@
   upb::Arena arena;
   upb::DefPool defpool;
   upb_StringView test_file_desc =
-      upb_upb_util_def_to_proto_test_proto_upbdefinit.descriptor;
+      upb_util_def_to_proto_test_proto_upbdefinit.descriptor;
   const auto* file_desc = google_protobuf_FileDescriptorProto_parse(
       test_file_desc.data, test_file_desc.size, arena.ptr());
 
   _upb_DefPool_LoadDefInitEx(
       defpool.ptr(),
-      &upb_upb_util_def_to_proto_test_proto_upbdefinit, true);
+      &upb_util_def_to_proto_test_proto_upbdefinit, true);
   upb::FileDefPtr file = defpool.FindFileByName(
-      upb_upb_util_def_to_proto_test_proto_upbdefinit.filename);
+      upb_util_def_to_proto_test_proto_upbdefinit.filename);
   CheckFile(file, file_desc);
 }
 
diff --git a/upb/upb/util/def_to_proto_test.h b/upb/util/def_to_proto_test.h
similarity index 96%
rename from upb/upb/util/def_to_proto_test.h
rename to upb/util/def_to_proto_test.h
index 8da7483..fdd102a 100644
--- a/upb/upb/util/def_to_proto_test.h
+++ b/upb/util/def_to_proto_test.h
@@ -17,10 +17,10 @@
 #include "google/protobuf/descriptor.h"
 #include "google/protobuf/dynamic_message.h"
 #include "google/protobuf/util/field_comparator.h"
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/reflection/def.hpp"
-#include "upb/upb/util/def_to_proto.h"
+#include "upb/base/status.hpp"
+#include "upb/mem/arena.hpp"
+#include "upb/reflection/def.hpp"
+#include "upb/util/def_to_proto.h"
 
 namespace upb_test {
 
diff --git a/upb/upb/util/def_to_proto_test.proto b/upb/util/def_to_proto_test.proto
similarity index 94%
rename from upb/upb/util/def_to_proto_test.proto
rename to upb/util/def_to_proto_test.proto
index 2d05320..e71c33a 100644
--- a/upb/upb/util/def_to_proto_test.proto
+++ b/upb/util/def_to_proto_test.proto
@@ -9,9 +9,9 @@
 
 package pkg;
 
-import public "upb/upb/util/def_to_proto_public_import_test.proto";
+import public "upb/util/def_to_proto_public_import_test.proto";
 
-import "upb/upb/util/def_to_proto_regular_import_test.proto";
+import "upb/util/def_to_proto_regular_import_test.proto";
 
 option optimize_for = CODE_SIZE;
 option go_package = "foo_go_package";
diff --git a/upb/upb/util/def_to_proto_weak_import_test.proto b/upb/util/def_to_proto_weak_import_test.proto
similarity index 100%
rename from upb/upb/util/def_to_proto_weak_import_test.proto
rename to upb/util/def_to_proto_weak_import_test.proto
diff --git a/upb/upb/util/def_to_proto_wweak_import_test.proto b/upb/util/def_to_proto_wweak_import_test.proto
similarity index 100%
rename from upb/upb/util/def_to_proto_wweak_import_test.proto
rename to upb/util/def_to_proto_wweak_import_test.proto
diff --git a/upb/upb/util/required_fields.c b/upb/util/required_fields.c
similarity index 96%
rename from upb/upb/util/required_fields.c
rename to upb/util/required_fields.c
index 685aca1..3e4c403 100644
--- a/upb/upb/util/required_fields.c
+++ b/upb/util/required_fields.c
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/util/required_fields.h"
+#include "upb/util/required_fields.h"
 
 #include <assert.h>
 #include <inttypes.h>
@@ -16,16 +16,16 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/collections/array.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/message/types.h"
-#include "upb/upb/port/vsnprintf_compat.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/message.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/collections/array.h"
+#include "upb/collections/map.h"
+#include "upb/message/types.h"
+#include "upb/port/vsnprintf_compat.h"
+#include "upb/reflection/def.h"
+#include "upb/reflection/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 ////////////////////////////////////////////////////////////////////////////////
 // upb_FieldPath_ToText()
diff --git a/upb/upb/util/required_fields.h b/upb/util/required_fields.h
similarity index 94%
rename from upb/upb/util/required_fields.h
rename to upb/util/required_fields.h
index fb78505..1e6bb9a 100644
--- a/upb/upb/util/required_fields.h
+++ b/upb/util/required_fields.h
@@ -10,11 +10,11 @@
 
 #include <stddef.h>
 
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/message.h"
+#include "upb/reflection/def.h"
+#include "upb/reflection/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -71,6 +71,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_UTIL_REQUIRED_FIELDS_H_ */
diff --git a/upb/upb/util/required_fields_test.cc b/upb/util/required_fields_test.cc
similarity index 94%
rename from upb/upb/util/required_fields_test.cc
rename to upb/util/required_fields_test.cc
index 87e6ece..4066e31 100644
--- a/upb/upb/util/required_fields_test.cc
+++ b/upb/util/required_fields_test.cc
@@ -5,19 +5,19 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/util/required_fields.h"
+#include "upb/util/required_fields.h"
 
 #include <stdlib.h>
 
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include "absl/strings/string_view.h"
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/json/decode.h"
-#include "upb/upb/mem/arena.hpp"
-#include "upb/upb/reflection/def.hpp"
-#include "upb/upb/util/required_fields_test.upb.h"
-#include "upb/upb/util/required_fields_test.upbdefs.h"
+#include "upb/base/status.hpp"
+#include "upb/json/decode.h"
+#include "upb/mem/arena.hpp"
+#include "upb/reflection/def.hpp"
+#include "upb/util/required_fields_test.upb.h"
+#include "upb/util/required_fields_test.upbdefs.h"
 
 std::vector<std::string> PathsToText(upb_FieldPathEntry* entry) {
   std::vector<std::string> ret;
diff --git a/upb/upb/util/required_fields_test.proto b/upb/util/required_fields_test.proto
similarity index 100%
rename from upb/upb/util/required_fields_test.proto
rename to upb/util/required_fields_test.proto
diff --git a/upb/upb/wire/BUILD b/upb/wire/BUILD
similarity index 96%
rename from upb/upb/wire/BUILD
rename to upb/wire/BUILD
index 96b9d61..4d9e31c 100644
--- a/upb/upb/wire/BUILD
+++ b/upb/wire/BUILD
@@ -5,7 +5,7 @@
 # license that can be found in the LICENSE file or at
 # https://developers.google.com/open-source/licenses/bsd
 
-load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
+load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
 
 cc_library(
     name = "wire",
@@ -103,8 +103,8 @@
     srcs = ["eps_copy_input_stream_test.cc"],
     deps = [
         ":eps_copy_input_stream",
-        "//upb:mem",
         "@com_google_googletest//:gtest_main",
+        "//upb:mem",
     ],
 )
 
@@ -119,7 +119,7 @@
     ),
     visibility = [
         "//upb/cmake:__pkg__",
-        "//upb/python/dist:__pkg__",
+        "//python/dist:__pkg__",
     ]
 )
 # end:github_only
diff --git a/upb/upb/wire/decode.c b/upb/wire/decode.c
similarity index 97%
rename from upb/upb/wire/decode.c
rename to upb/wire/decode.c
index 3aa9b58..b3b8f92 100644
--- a/upb/upb/wire/decode.c
+++ b/upb/wire/decode.c
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/wire/decode.h"
+#include "upb/wire/decode.h"
 
 #include <assert.h>
 #include <stdbool.h>
@@ -13,40 +13,40 @@
 #include <stdint.h>
 #include <string.h>
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/collections/array.h"
-#include "upb/upb/collections/internal/array.h"
-#include "upb/upb/collections/internal/map.h"
-#include "upb/upb/collections/internal/map_entry.h"
-#include "upb/upb/collections/map.h"
-#include "upb/upb/hash/common.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mem/internal/arena.h"
-#include "upb/upb/message/internal/accessors.h"
-#include "upb/upb/message/internal/extension.h"
-#include "upb/upb/message/internal/message.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/message/tagged_ptr.h"
-#include "upb/upb/mini_table/enum.h"
-#include "upb/upb/mini_table/extension.h"
-#include "upb/upb/mini_table/extension_registry.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/internal/enum.h"
-#include "upb/upb/mini_table/internal/field.h"
-#include "upb/upb/mini_table/internal/message.h"
-#include "upb/upb/mini_table/message.h"
-#include "upb/upb/mini_table/sub.h"
-#include "upb/upb/port/atomic.h"
-#include "upb/upb/wire/encode.h"
-#include "upb/upb/wire/eps_copy_input_stream.h"
-#include "upb/upb/wire/internal/constants.h"
-#include "upb/upb/wire/internal/decode.h"
-#include "upb/upb/wire/internal/swap.h"
-#include "upb/upb/wire/reader.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/base/string_view.h"
+#include "upb/collections/array.h"
+#include "upb/collections/internal/array.h"
+#include "upb/collections/internal/map.h"
+#include "upb/collections/internal/map_entry.h"
+#include "upb/collections/map.h"
+#include "upb/hash/common.h"
+#include "upb/mem/arena.h"
+#include "upb/mem/internal/arena.h"
+#include "upb/message/internal/accessors.h"
+#include "upb/message/internal/extension.h"
+#include "upb/message/internal/message.h"
+#include "upb/message/message.h"
+#include "upb/message/tagged_ptr.h"
+#include "upb/mini_table/enum.h"
+#include "upb/mini_table/extension.h"
+#include "upb/mini_table/extension_registry.h"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/internal/enum.h"
+#include "upb/mini_table/internal/field.h"
+#include "upb/mini_table/internal/message.h"
+#include "upb/mini_table/message.h"
+#include "upb/mini_table/sub.h"
+#include "upb/port/atomic.h"
+#include "upb/wire/encode.h"
+#include "upb/wire/eps_copy_input_stream.h"
+#include "upb/wire/internal/constants.h"
+#include "upb/wire/internal/decode.h"
+#include "upb/wire/internal/swap.h"
+#include "upb/wire/reader.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 // A few fake field types for our tables.
 enum {
diff --git a/upb/upb/wire/decode.h b/upb/wire/decode.h
similarity index 95%
rename from upb/upb/wire/decode.h
rename to upb/wire/decode.h
index bbf7505..7f2eafd 100644
--- a/upb/upb/wire/decode.h
+++ b/upb/wire/decode.h
@@ -13,13 +13,13 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/mini_table/extension_registry.h"
-#include "upb/upb/mini_table/message.h"
+#include "upb/mem/arena.h"
+#include "upb/message/message.h"
+#include "upb/mini_table/extension_registry.h"
+#include "upb/mini_table/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -127,6 +127,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_WIRE_DECODE_H_ */
diff --git a/upb/upb/wire/decode_fast.c b/upb/wire/decode_fast.c
similarity index 99%
rename from upb/upb/wire/decode_fast.c
rename to upb/wire/decode_fast.c
index 1935d00..857d84a 100644
--- a/upb/upb/wire/decode_fast.c
+++ b/upb/wire/decode_fast.c
@@ -15,14 +15,14 @@
 // field type (eg. oneof boolean field with a 1 byte tag) and then dispatch
 // to the specialized function as quickly as possible.
 
-#include "upb/upb/wire/decode_fast.h"
+#include "upb/wire/decode_fast.h"
 
-#include "upb/upb/collections/internal/array.h"
-#include "upb/upb/message/internal/types.h"
-#include "upb/upb/wire/internal/decode.h"
+#include "upb/collections/internal/array.h"
+#include "upb/message/internal/types.h"
+#include "upb/wire/internal/decode.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #if UPB_FASTTABLE
 
diff --git a/upb/upb/wire/decode_fast.h b/upb/wire/decode_fast.h
similarity index 97%
rename from upb/upb/wire/decode_fast.h
rename to upb/wire/decode_fast.h
index 70f03b8..395342a 100644
--- a/upb/upb/wire/decode_fast.h
+++ b/upb/wire/decode_fast.h
@@ -42,10 +42,10 @@
 #ifndef UPB_WIRE_DECODE_FAST_H_
 #define UPB_WIRE_DECODE_FAST_H_
 
-#include "upb/upb/message/message.h"
+#include "upb/message/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -142,6 +142,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_WIRE_DECODE_FAST_H_ */
diff --git a/upb/upb/wire/encode.c b/upb/wire/encode.c
similarity index 95%
rename from upb/upb/wire/encode.c
rename to upb/wire/encode.c
index a8ce4ec..367199c 100644
--- a/upb/upb/wire/encode.c
+++ b/upb/wire/encode.c
@@ -7,38 +7,38 @@
 
 // We encode backwards, to avoid pre-computing lengths (one-pass encode).
 
-#include "upb/upb/wire/encode.h"
+#include "upb/wire/encode.h"
 
 #include <setjmp.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <string.h>
 
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/collections/array.h"
-#include "upb/upb/collections/internal/array.h"
-#include "upb/upb/collections/internal/map.h"
-#include "upb/upb/collections/internal/map_entry.h"
-#include "upb/upb/collections/internal/map_sorter.h"
-#include "upb/upb/hash/common.h"
-#include "upb/upb/hash/str_table.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/message/internal/accessors.h"
-#include "upb/upb/message/internal/extension.h"
-#include "upb/upb/message/message.h"
-#include "upb/upb/message/tagged_ptr.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/internal/field.h"
-#include "upb/upb/mini_table/internal/message.h"
-#include "upb/upb/mini_table/message.h"
-#include "upb/upb/mini_table/sub.h"
-#include "upb/upb/wire/internal/constants.h"
-#include "upb/upb/wire/internal/swap.h"
-#include "upb/upb/wire/types.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/base/string_view.h"
+#include "upb/collections/array.h"
+#include "upb/collections/internal/array.h"
+#include "upb/collections/internal/map.h"
+#include "upb/collections/internal/map_entry.h"
+#include "upb/collections/internal/map_sorter.h"
+#include "upb/hash/common.h"
+#include "upb/hash/str_table.h"
+#include "upb/mem/arena.h"
+#include "upb/message/internal/accessors.h"
+#include "upb/message/internal/extension.h"
+#include "upb/message/message.h"
+#include "upb/message/tagged_ptr.h"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/internal/field.h"
+#include "upb/mini_table/internal/message.h"
+#include "upb/mini_table/message.h"
+#include "upb/mini_table/sub.h"
+#include "upb/wire/internal/constants.h"
+#include "upb/wire/internal/swap.h"
+#include "upb/wire/types.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #define UPB_PB_VARINT_MAX_LEN 10
 
diff --git a/upb/upb/wire/encode.h b/upb/wire/encode.h
similarity index 93%
rename from upb/upb/wire/encode.h
rename to upb/wire/encode.h
index 640e668..6fb5553 100644
--- a/upb/upb/wire/encode.h
+++ b/upb/wire/encode.h
@@ -13,11 +13,11 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/mini_table/message.h"
+#include "upb/mem/arena.h"
+#include "upb/mini_table/message.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -71,6 +71,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_WIRE_ENCODE_H_ */
diff --git a/upb/upb/wire/eps_copy_input_stream.c b/upb/wire/eps_copy_input_stream.c
similarity index 93%
rename from upb/upb/wire/eps_copy_input_stream.c
rename to upb/wire/eps_copy_input_stream.c
index 0554ead..150cde8 100644
--- a/upb/upb/wire/eps_copy_input_stream.c
+++ b/upb/wire/eps_copy_input_stream.c
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/wire/eps_copy_input_stream.h"
+#include "upb/wire/eps_copy_input_stream.h"
 
 static const char* _upb_EpsCopyInputStream_NoOpCallback(
     upb_EpsCopyInputStream* e, const char* old_end, const char* new_start) {
diff --git a/upb/upb/wire/eps_copy_input_stream.h b/upb/wire/eps_copy_input_stream.h
similarity index 99%
rename from upb/upb/wire/eps_copy_input_stream.h
rename to upb/wire/eps_copy_input_stream.h
index 5f17a0e..3d04f1e 100644
--- a/upb/upb/wire/eps_copy_input_stream.h
+++ b/upb/wire/eps_copy_input_stream.h
@@ -10,10 +10,10 @@
 
 #include <string.h>
 
-#include "upb/upb/mem/arena.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -400,6 +400,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_WIRE_EPS_COPY_INPUT_STREAM_H_
diff --git a/upb/upb/wire/eps_copy_input_stream_test.cc b/upb/wire/eps_copy_input_stream_test.cc
similarity index 98%
rename from upb/upb/wire/eps_copy_input_stream_test.cc
rename to upb/wire/eps_copy_input_stream_test.cc
index 3230ff2..61445c3 100644
--- a/upb/upb/wire/eps_copy_input_stream_test.cc
+++ b/upb/wire/eps_copy_input_stream_test.cc
@@ -5,14 +5,14 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/wire/eps_copy_input_stream.h"
+#include "upb/wire/eps_copy_input_stream.h"
 
 #include <string.h>
 
 #include <string>
 
 #include <gtest/gtest.h>
-#include "upb/upb/mem/arena.hpp"
+#include "upb/mem/arena.hpp"
 // begin:google_only
 // #include "testing/fuzzing/fuzztest.h"
 // end:google_only
diff --git a/upb/upb/wire/internal/constants.h b/upb/wire/internal/constants.h
similarity index 100%
rename from upb/upb/wire/internal/constants.h
rename to upb/wire/internal/constants.h
diff --git a/upb/upb/wire/internal/decode.h b/upb/wire/internal/decode.h
similarity index 94%
rename from upb/upb/wire/internal/decode.h
rename to upb/wire/internal/decode.h
index b01b339..a058ecb 100644
--- a/upb/upb/wire/internal/decode.h
+++ b/upb/wire/internal/decode.h
@@ -13,14 +13,14 @@
 #ifndef UPB_WIRE_INTERNAL_DECODE_H_
 #define UPB_WIRE_INTERNAL_DECODE_H_
 
-#include "upb/upb/mem/internal/arena.h"
-#include "upb/upb/message/internal/message.h"
-#include "upb/upb/wire/decode.h"
-#include "upb/upb/wire/eps_copy_input_stream.h"
+#include "upb/mem/internal/arena.h"
+#include "upb/message/internal/message.h"
+#include "upb/wire/decode.h"
+#include "upb/wire/eps_copy_input_stream.h"
 #include "utf8_range.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #define DECODE_NOGROUP (uint32_t) - 1
 
@@ -138,6 +138,6 @@
   return tag;
 }
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_WIRE_INTERNAL_DECODE_H_ */
diff --git a/upb/upb/wire/internal/swap.h b/upb/wire/internal/swap.h
similarity index 93%
rename from upb/upb/wire/internal/swap.h
rename to upb/wire/internal/swap.h
index 21e9212..a203e45 100644
--- a/upb/upb/wire/internal/swap.h
+++ b/upb/wire/internal/swap.h
@@ -11,7 +11,7 @@
 #include <stdint.h>
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -40,6 +40,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPB_WIRE_INTERNAL_SWAP_H_ */
diff --git a/upb/upb/wire/reader.c b/upb/wire/reader.c
similarity index 89%
rename from upb/upb/wire/reader.c
rename to upb/wire/reader.c
index df46580..de6cde4 100644
--- a/upb/upb/wire/reader.c
+++ b/upb/wire/reader.c
@@ -5,13 +5,13 @@
 // license that can be found in the LICENSE file or at
 // https://developers.google.com/open-source/licenses/bsd
 
-#include "upb/upb/wire/reader.h"
+#include "upb/wire/reader.h"
 
-#include "upb/upb/wire/eps_copy_input_stream.h"
-#include "upb/upb/wire/types.h"
+#include "upb/wire/eps_copy_input_stream.h"
+#include "upb/wire/types.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 UPB_NOINLINE _upb_WireReader_ReadLongVarintRet
 _upb_WireReader_ReadLongVarint(const char* ptr, uint64_t val) {
diff --git a/upb/upb/wire/reader.h b/upb/wire/reader.h
similarity index 96%
rename from upb/upb/wire/reader.h
rename to upb/wire/reader.h
index fe14086..2181aa6 100644
--- a/upb/upb/wire/reader.h
+++ b/upb/wire/reader.h
@@ -8,12 +8,12 @@
 #ifndef UPB_WIRE_READER_H_
 #define UPB_WIRE_READER_H_
 
-#include "upb/upb/wire/eps_copy_input_stream.h"
-#include "upb/upb/wire/internal/swap.h"
-#include "upb/upb/wire/types.h"  // IWYU pragma: export
+#include "upb/wire/eps_copy_input_stream.h"
+#include "upb/wire/internal/swap.h"
+#include "upb/wire/types.h"  // IWYU pragma: export
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -202,6 +202,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_WIRE_READER_H_
diff --git a/upb/upb/wire/types.h b/upb/wire/types.h
similarity index 100%
rename from upb/upb/wire/types.h
rename to upb/wire/types.h
diff --git a/upb/upbc/BUILD b/upbc/BUILD
similarity index 93%
rename from upb/upbc/BUILD
rename to upbc/BUILD
index db554a8..399a14e 100644
--- a/upb/upbc/BUILD
+++ b/upbc/BUILD
@@ -6,21 +6,21 @@
 # https://developers.google.com/open-source/licenses/bsd
 
 load(
-    "//upb/bazel:build_defs.bzl",
+    "//bazel:build_defs.bzl",
     "UPB_DEFAULT_COPTS",
     "UPB_DEFAULT_CPPOPTS",
 )
 load(
-    "//upb/bazel:upb_minitable_proto_library.bzl",
+    "//bazel:upb_minitable_proto_library.bzl",
     "upb_minitable_proto_library",
 )
 load(
-    "//upb/bazel:upb_proto_library.bzl",
+    "//bazel:upb_proto_library.bzl",
     "upb_proto_library",
     "upb_proto_reflection_library",
 )
 load(
-    "//upb/upbc:bootstrap_compiler.bzl",
+    "//upbc:bootstrap_compiler.bzl",
     "bootstrap_cc_binary",
     "bootstrap_cc_library",
     "bootstrap_upb_proto_library",
@@ -69,7 +69,7 @@
     google3_src_rules = [
         "//net/proto2/proto:descriptor_proto_source",
         "//net/proto2/compiler/proto:profile.proto",
-        "//third_party/protobuf/compiler:plugin_proto_source",
+        "//src/google/protobuf/compiler:plugin_proto_source",
     ],
     oss_src_files = ["google/protobuf/compiler/plugin.proto"],
     oss_src_rules = [
@@ -100,7 +100,7 @@
         "//upb:reflection",
     ],
     copts = UPB_DEFAULT_CPPOPTS,
-    visibility = ["//upb/protos_generator:__pkg__"],
+    visibility = ["//protos_generator:__pkg__"],
     deps = [
         "//upb:mini_table",
         "//upb:mini_table_internal",
@@ -123,7 +123,7 @@
         "//upb:descriptor_upb_proto",
     ],
     copts = UPB_DEFAULT_CPPOPTS,
-    visibility = ["//upb/protos_generator:__pkg__"],
+    visibility = ["//protos_generator:__pkg__"],
     deps = [
         "//upb:base",
         "//upb:mini_descriptor",
@@ -144,7 +144,7 @@
         "keywords.h",
     ],
     copts = UPB_DEFAULT_CPPOPTS,
-    visibility = ["//upb/protos_generator:__pkg__"],
+    visibility = ["//protos_generator:__pkg__"],
 )
 
 bootstrap_cc_library(
@@ -158,7 +158,7 @@
         "//upb:reflection",
     ],
     copts = UPB_DEFAULT_CPPOPTS,
-    visibility = ["//upb/protos_generator:__pkg__"],
+    visibility = ["//protos_generator:__pkg__"],
     deps = [
         "//upb:port",
         "@com_google_absl//absl/container:flat_hash_set",
@@ -180,7 +180,7 @@
         "//upb:reflection",
     ],
     copts = UPB_DEFAULT_CPPOPTS,
-    visibility = ["//upb/protos_generator:__pkg__"],
+    visibility = ["//protos_generator:__pkg__"],
     deps = [
         "//:protobuf",
         "//src/google/protobuf/compiler:code_generator",
@@ -309,7 +309,7 @@
         ":plugin",
         "//upb:descriptor_upb_proto",
         "//upb:reflection",
-        "//upb/upb/util:def_to_proto",
+        "//upb/util:def_to_proto",
     ],
 )
 
diff --git a/upb/upbc/bootstrap_compiler.bzl b/upbc/bootstrap_compiler.bzl
similarity index 96%
rename from upb/upbc/bootstrap_compiler.bzl
rename to upbc/bootstrap_compiler.bzl
index 8301364..fcc1102 100644
--- a/upb/upbc/bootstrap_compiler.bzl
+++ b/upbc/bootstrap_compiler.bzl
@@ -1,7 +1,7 @@
 """Macros that implement bootstrapping for the upb code generator."""
 
 load(
-    "//upb/bazel:upb_proto_library.bzl",
+    "//bazel:upb_proto_library.bzl",
     "upb_proto_library",
 )
 load(
@@ -11,7 +11,7 @@
 
 _stages = ["_stage0", "_stage1", ""]
 _protoc = "//:protoc"
-_upbc_base = "//upb/upbc:protoc-gen-"
+_upbc_base = "//upbc:protoc-gen-"
 
 # begin:google_only
 # _is_google3 = True
@@ -28,7 +28,7 @@
 
 def bootstrap_cc_library(name, visibility, deps, bootstrap_deps, **kwargs):
     for stage in _stages:
-        stage_visibility = visibility if stage == "" else ["//upb/upbc:__pkg__"]
+        stage_visibility = visibility if stage == "" else ["//upbc:__pkg__"]
         native.cc_library(
             name = name + stage,
             deps = deps + [dep + stage for dep in bootstrap_deps],
@@ -93,7 +93,7 @@
               "=$(location " + _upbc(generator, 0) + ") " + _extra_proto_path +
               "--" + generator + "_out=$(RULEDIR)/" + base_dir + "stage1 " +
               " ".join(src_files),
-        visibility = ["//upb/upbc:__pkg__"],
+        visibility = ["//upbc:__pkg__"],
         tools = [
             _protoc,
             _upbc(generator, 0),
@@ -140,7 +140,7 @@
         srcs = _generated_srcs_for_suffix(base_dir + "stage0", oss_src_files, ".upb.c"),
         hdrs = _generated_srcs_for_suffix(base_dir + "stage0", oss_src_files, ".upb.h"),
         includes = [base_dir + "stage0"],
-        visibility = ["//upb/upbc:__pkg__"],
+        visibility = ["//upbc:__pkg__"],
         # This macro signals to the runtime that it must use OSS APIs for descriptor.proto/plugin.proto.
         defines = ["UPB_BOOTSTRAP_STAGE0"],
         deps = [
@@ -162,7 +162,7 @@
         srcs = _generated_srcs_for_suffix(base_dir + "stage1", src_files, ".upb_minitable.c"),
         hdrs = _generated_srcs_for_suffix(base_dir + "stage1", src_files, ".upb_minitable.h"),
         includes = [base_dir + "stage1"],
-        visibility = ["//upb/upbc:__pkg__"],
+        visibility = ["//upbc:__pkg__"],
         deps = [
             "//upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
         ] + [dep + "_stage1" for dep in deps],
@@ -172,7 +172,7 @@
         name = name + "_stage1",
         hdrs = _generated_srcs_for_suffix(base_dir + "stage1", src_files, ".upb.h"),
         includes = [base_dir + "stage1"],
-        visibility = ["//upb/upbc:__pkg__"],
+        visibility = ["//upbc:__pkg__"],
         deps = [
             "//upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
             ":" + name + "_minitable_stage1",
diff --git a/upb/upbc/code_generator_request.c b/upbc/code_generator_request.c
similarity index 98%
rename from upb/upbc/code_generator_request.c
rename to upbc/code_generator_request.c
index f302c0a..4ab5fcc 100644
--- a/upb/upbc/code_generator_request.c
+++ b/upbc/code_generator_request.c
@@ -28,16 +28,16 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upbc/code_generator_request.h"
+#include "upbc/code_generator_request.h"
 
 #include <inttypes.h>
 
 #include "google/protobuf/compiler/plugin.upb.h"
-#include "upb/upb/mini_descriptor/decode.h"
-#include "upb/upb/reflection/def.h"
+#include "upb/mini_descriptor/decode.h"
+#include "upb/reflection/def.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 /******************************************************************************/
 
diff --git a/upb/upbc/code_generator_request.h b/upbc/code_generator_request.h
similarity index 91%
rename from upb/upbc/code_generator_request.h
rename to upbc/code_generator_request.h
index ba1038f..3218c08 100644
--- a/upb/upbc/code_generator_request.h
+++ b/upbc/code_generator_request.h
@@ -31,12 +31,12 @@
 #ifndef UPBC_CODE_GENERATOR_REQUEST_H_
 #define UPBC_CODE_GENERATOR_REQUEST_H_
 
-#include "upb/upb/mem/arena.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upbc/code_generator_request.upb.h"
+#include "upb/mem/arena.h"
+#include "upb/reflection/def.h"
+#include "upbc/code_generator_request.upb.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -50,6 +50,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif /* UPBC_CODE_GENERATOR_REQUEST_H_ */
diff --git a/upb/upbc/code_generator_request.proto b/upbc/code_generator_request.proto
similarity index 100%
rename from upb/upbc/code_generator_request.proto
rename to upbc/code_generator_request.proto
diff --git a/upb/upbc/common.cc b/upbc/common.cc
similarity index 96%
rename from upb/upbc/common.cc
rename to upbc/common.cc
index 1e46cf7..b5bad20 100644
--- a/upb/upbc/common.cc
+++ b/upbc/common.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upbc/common.h"
+#include "upbc/common.h"
 
 #include <assert.h>
 #include <stdint.h>
@@ -41,12 +41,12 @@
 #include "absl/strings/str_replace.h"
 #include "absl/strings/string_view.h"
 #include "absl/strings/substitute.h"
-#include "upb/upb/mini_table/field.h"
-#include "upb/upb/mini_table/internal/field.h"
-#include "upb/upb/reflection/def.hpp"
+#include "upb/mini_table/field.h"
+#include "upb/mini_table/internal/field.h"
+#include "upb/reflection/def.hpp"
 
 // Must be last
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace upbc {
 
diff --git a/upb/upbc/common.h b/upbc/common.h
similarity index 98%
rename from upb/upbc/common.h
rename to upbc/common.h
index 4cd0aac..e607714 100644
--- a/upb/upbc/common.h
+++ b/upbc/common.h
@@ -35,7 +35,7 @@
 
 #include "absl/strings/str_replace.h"
 #include "absl/strings/substitute.h"
-#include "upb/upb/reflection/def.hpp"
+#include "upb/reflection/def.hpp"
 
 namespace upbc {
 
diff --git a/upb/upbc/file_layout.cc b/upbc/file_layout.cc
similarity index 97%
rename from upb/upbc/file_layout.cc
rename to upbc/file_layout.cc
index 4c21996..fab6120 100644
--- a/upb/upbc/file_layout.cc
+++ b/upbc/file_layout.cc
@@ -28,13 +28,13 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upbc/file_layout.h"
+#include "upbc/file_layout.h"
 
 #include <string>
 #include <unordered_set>
 
-#include "upb/upb/mini_table/internal/extension.h"
-#include "upb/upbc/common.h"
+#include "upb/mini_table/internal/extension.h"
+#include "upbc/common.h"
 
 namespace upbc {
 
diff --git a/upb/upbc/file_layout.h b/upbc/file_layout.h
similarity index 95%
rename from upb/upbc/file_layout.h
rename to upbc/file_layout.h
index 92e078a..9df43aa 100644
--- a/upb/upbc/file_layout.h
+++ b/upbc/file_layout.h
@@ -46,13 +46,13 @@
 // end:github_only
 
 #include "absl/container/flat_hash_map.h"
-#include "upb/upb/base/status.hpp"
-#include "upb/upb/mini_descriptor/decode.h"
-#include "upb/upb/reflection/def.h"
-#include "upb/upb/reflection/def.hpp"
+#include "upb/base/status.hpp"
+#include "upb/mini_descriptor/decode.h"
+#include "upb/reflection/def.h"
+#include "upb/reflection/def.hpp"
 
 // Must be last
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace upbc {
 
@@ -124,6 +124,6 @@
 
 }  // namespace upbc
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPBC_FILE_LAYOUT_H
diff --git a/upb/upbc/get_used_fields.c b/upbc/get_used_fields.c
similarity index 94%
rename from upb/upbc/get_used_fields.c
rename to upbc/get_used_fields.c
index f07ccc1..796e501 100644
--- a/upb/upbc/get_used_fields.c
+++ b/upbc/get_used_fields.c
@@ -28,18 +28,18 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upbc/get_used_fields.h"
+#include "upbc/get_used_fields.h"
 
 #include "google/protobuf/descriptor.upb.h"
 #include "google/protobuf/compiler/plugin.upb.h"
-#include "upb/upb/reflection/def_pool.h"
-#include "upb/upb/reflection/field_def.h"
-#include "upb/upb/reflection/message.h"
-#include "upb/upb/reflection/message_def.h"
-#include "upb/upb/wire/decode.h"
+#include "upb/reflection/def_pool.h"
+#include "upb/reflection/field_def.h"
+#include "upb/reflection/message.h"
+#include "upb/reflection/message_def.h"
+#include "upb/wire/decode.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #define upbdev_Err(...)           \
   {                               \
diff --git a/upb/upbc/get_used_fields.h b/upbc/get_used_fields.h
similarity index 92%
rename from upb/upbc/get_used_fields.h
rename to upbc/get_used_fields.h
index 6bbbfd3..ccf3208 100644
--- a/upb/upbc/get_used_fields.h
+++ b/upbc/get_used_fields.h
@@ -31,12 +31,12 @@
 #ifndef UPBC_GET_USED_FIELDS
 #define UPBC_GET_USED_FIELDS
 
-#include "upb/upb/base/status.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/mem/arena.h"
+#include "upb/base/status.h"
+#include "upb/base/string_view.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,6 +52,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPBC_GET_USED_FIELDS
diff --git a/upb/upbc/keywords.cc b/upbc/keywords.cc
similarity index 98%
rename from upb/upbc/keywords.cc
rename to upbc/keywords.cc
index 95abec3..3f51705 100644
--- a/upb/upbc/keywords.cc
+++ b/upbc/keywords.cc
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upbc/keywords.h"
+#include "upbc/keywords.h"
 
 #include <string>
 #include <unordered_set>
diff --git a/upb/upbc/keywords.h b/upbc/keywords.h
similarity index 100%
rename from upb/upbc/keywords.h
rename to upbc/keywords.h
diff --git a/upb/upbc/names.cc b/upbc/names.cc
similarity index 98%
rename from upb/upbc/names.cc
rename to upbc/names.cc
index 0f9d4b6..63521b8 100644
--- a/upb/upbc/names.cc
+++ b/upbc/names.cc
@@ -28,14 +28,14 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upbc/names.h"
+#include "upbc/names.h"
 
 #include <string>
 
 #include "absl/strings/match.h"
 #include "absl/strings/string_view.h"
 #include "google/protobuf/descriptor.h"
-#include "upb/upb/reflection/def.hpp"
+#include "upb/reflection/def.hpp"
 
 namespace upbc {
 
diff --git a/upb/upbc/names.h b/upbc/names.h
similarity index 98%
rename from upb/upbc/names.h
rename to upbc/names.h
index f8f7b94..87b0a15 100644
--- a/upb/upbc/names.h
+++ b/upbc/names.h
@@ -37,7 +37,7 @@
 #include "absl/container/flat_hash_map.h"
 #include "absl/strings/string_view.h"
 #include "google/protobuf/descriptor.h"
-#include "upb/upb/reflection/def.hpp"
+#include "upb/reflection/def.hpp"
 
 namespace upbc {
 
diff --git a/upb/upbc/plugin.h b/upbc/plugin.h
similarity index 98%
rename from upb/upbc/plugin.h
rename to upbc/plugin.h
index bb4b1b0..465bda0 100644
--- a/upb/upbc/plugin.h
+++ b/upbc/plugin.h
@@ -59,10 +59,10 @@
 #include "absl/log/absl_log.h"
 #include "absl/strings/str_split.h"
 #include "absl/strings/string_view.h"
-#include "upb/upb/reflection/def.hpp"
+#include "upb/reflection/def.hpp"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace upbc {
 
@@ -207,6 +207,6 @@
 
 }  // namespace upbc
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPB_UPBC_PLUGIN_H_
diff --git a/upb/upbc/protoc-gen-upb.cc b/upbc/protoc-gen-upb.cc
similarity index 98%
rename from upb/upbc/protoc-gen-upb.cc
rename to upbc/protoc-gen-upb.cc
index e698f0d..0fa716a 100644
--- a/upb/upbc/protoc-gen-upb.cc
+++ b/upbc/protoc-gen-upb.cc
@@ -49,17 +49,17 @@
 #include "absl/strings/str_replace.h"
 #include "absl/strings/string_view.h"
 #include "absl/strings/substitute.h"
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/reflection/def.hpp"
-#include "upb/upb/wire/types.h"
-#include "upb/upbc/common.h"
-#include "upb/upbc/file_layout.h"
-#include "upb/upbc/names.h"
-#include "upb/upbc/plugin.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/base/string_view.h"
+#include "upb/reflection/def.hpp"
+#include "upb/wire/types.h"
+#include "upbc/common.h"
+#include "upbc/file_layout.h"
+#include "upbc/names.h"
+#include "upbc/plugin.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace upbc {
 namespace {
@@ -866,7 +866,7 @@
   output(
       "#ifndef $0_UPB_H_\n"
       "#define $0_UPB_H_\n\n"
-      "#include \"upb/upb/generated_code_support.h\"\n\n",
+      "#include \"upb/generated_code_support.h\"\n\n",
       ToPreproc(file.name()));
 
   for (int i = 0; i < file.public_dependency_count(); i++) {
@@ -891,7 +891,7 @@
 
   output(
       "// Must be last.\n"
-      "#include \"upb/upb/port/def.inc\"\n"
+      "#include \"upb/port/def.inc\"\n"
       "\n"
       "#ifdef __cplusplus\n"
       "extern \"C\" {\n"
@@ -977,7 +977,7 @@
       "}  /* extern \"C\" */\n"
       "#endif\n"
       "\n"
-      "#include \"upb/upb/port/undef.inc\"\n"
+      "#include \"upb/port/undef.inc\"\n"
       "\n"
       "#endif  /* $0_UPB_H_ */\n",
       ToPreproc(file.name()));
@@ -1064,7 +1064,7 @@
                                const Options& options, Output& output) {
   output(
       "#include <stddef.h>\n"
-      "#include \"upb/upb/generated_code_support.h\"\n"
+      "#include \"upb/generated_code_support.h\"\n"
       "#include \"$0\"\n\n",
       CApiHeaderFilename(file));
 
diff --git a/upb/upbc/protoc-gen-upb_minitable.cc b/upbc/protoc-gen-upb_minitable.cc
similarity index 97%
rename from upb/upbc/protoc-gen-upb_minitable.cc
rename to upbc/protoc-gen-upb_minitable.cc
index c1b4794..745dc84 100644
--- a/upb/upbc/protoc-gen-upb_minitable.cc
+++ b/upbc/protoc-gen-upb_minitable.cc
@@ -45,17 +45,17 @@
 #include "absl/strings/str_replace.h"
 #include "absl/strings/string_view.h"
 #include "absl/strings/substitute.h"
-#include "upb/upb/base/descriptor_constants.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/reflection/def.hpp"
-#include "upb/upb/wire/types.h"
-#include "upb/upbc/common.h"
-#include "upb/upbc/file_layout.h"
-#include "upb/upbc/names.h"
-#include "upb/upbc/plugin.h"
+#include "upb/base/descriptor_constants.h"
+#include "upb/base/string_view.h"
+#include "upb/reflection/def.hpp"
+#include "upb/wire/types.h"
+#include "upbc/common.h"
+#include "upbc/file_layout.h"
+#include "upbc/names.h"
+#include "upbc/plugin.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace upbc {
 namespace {
@@ -111,7 +111,7 @@
   output(
       "#ifndef $0_UPB_MINITABLE_H_\n"
       "#define $0_UPB_MINITABLE_H_\n\n"
-      "#include \"upb/upb/generated_code_support.h\"\n",
+      "#include \"upb/generated_code_support.h\"\n",
       ToPreproc(file.name()));
 
   for (int i = 0; i < file.public_dependency_count(); i++) {
@@ -128,7 +128,7 @@
   output(
       "\n"
       "// Must be last.\n"
-      "#include \"upb/upb/port/def.inc\"\n"
+      "#include \"upb/port/def.inc\"\n"
       "\n"
       "#ifdef __cplusplus\n"
       "extern \"C\" {\n"
@@ -163,7 +163,7 @@
       "}  /* extern \"C\" */\n"
       "#endif\n"
       "\n"
-      "#include \"upb/upb/port/undef.inc\"\n"
+      "#include \"upb/port/undef.inc\"\n"
       "\n"
       "#endif  /* $0_UPB_MINITABLE_H_ */\n",
       ToPreproc(file.name()));
@@ -630,7 +630,7 @@
 
   output(
       "#include <stddef.h>\n"
-      "#include \"upb/upb/generated_code_support.h\"\n"
+      "#include \"upb/generated_code_support.h\"\n"
       "#include \"$0\"\n",
       MiniTableHeaderFilename(file));
 
@@ -641,7 +641,7 @@
   output(
       "\n"
       "// Must be last.\n"
-      "#include \"upb/upb/port/def.inc\"\n"
+      "#include \"upb/port/def.inc\"\n"
       "\n");
 
   int msg_count = WriteMessages(pools, file, output);
@@ -657,7 +657,7 @@
   output("  $0,\n", ext_count);
   output("};\n\n");
 
-  output("#include \"upb/upb/port/undef.inc\"\n");
+  output("#include \"upb/port/undef.inc\"\n");
   output("\n");
 }
 
diff --git a/upb/upbc/protoc-gen-upbdefs.cc b/upbc/protoc-gen-upbdefs.cc
similarity index 91%
rename from upb/upbc/protoc-gen-upbdefs.cc
rename to upbc/protoc-gen-upbdefs.cc
index c5cc534..d2870b0 100644
--- a/upb/upbc/protoc-gen-upbdefs.cc
+++ b/upbc/protoc-gen-upbdefs.cc
@@ -31,11 +31,11 @@
 #include <memory>
 
 #include "google/protobuf/descriptor.upb.h"
-#include "upb/upb/reflection/def.hpp"
-#include "upb/upb/util/def_to_proto.h"
-#include "upb/upbc/common.h"
-#include "upb/upbc/file_layout.h"
-#include "upb/upbc/plugin.h"
+#include "upb/reflection/def.hpp"
+#include "upb/util/def_to_proto.h"
+#include "upbc/common.h"
+#include "upbc/file_layout.h"
+#include "upbc/plugin.h"
 
 namespace upbc {
 namespace {
@@ -67,17 +67,17 @@
   output(
       "#ifndef $0_UPBDEFS_H_\n"
       "#define $0_UPBDEFS_H_\n\n"
-      "#include \"upb/upb/reflection/def.h\"\n"
-      "#include \"upb/upb/reflection/internal/def_pool.h\"\n"
-      "#include \"upb/upb/port/def.inc\"\n"
+      "#include \"upb/reflection/def.h\"\n"
+      "#include \"upb/reflection/internal/def_pool.h\"\n"
+      "#include \"upb/port/def.inc\"\n"
       "#ifdef __cplusplus\n"
       "extern \"C\" {\n"
       "#endif\n\n",
       ToPreproc(file.name()));
 
-  output("#include \"upb/upb/reflection/def.h\"\n");
+  output("#include \"upb/reflection/def.h\"\n");
   output("\n");
-  output("#include \"upb/upb/port/def.inc\"\n");
+  output("#include \"upb/port/def.inc\"\n");
   output("\n");
 
   output("extern _upb_DefPool_Init $0;\n", DefInitSymbol(file));
@@ -92,7 +92,7 @@
       "}  /* extern \"C\" */\n"
       "#endif\n"
       "\n"
-      "#include \"upb/upb/port/undef.inc\"\n"
+      "#include \"upb/port/undef.inc\"\n"
       "\n"
       "#endif  /* $0_UPBDEFS_H_ */\n",
       ToPreproc(file.name()));
@@ -101,7 +101,7 @@
 void WriteDefSource(upb::FileDefPtr file, Output& output) {
   EmitFileWarning(file.name(), output);
 
-  output("#include \"upb/upb/reflection/def.h\"\n");
+  output("#include \"upb/reflection/def.h\"\n");
   output("#include \"$0\"\n", DefHeaderFilename(file));
   output("#include \"$0\"\n", MiniTableHeaderFilename(file));
   output("\n");
diff --git a/upb/upbc/protoc-gen-upbdev.cc b/upbc/protoc-gen-upbdev.cc
similarity index 98%
rename from upb/upbc/protoc-gen-upbdev.cc
rename to upbc/protoc-gen-upbdev.cc
index 6b209f0..3093169 100644
--- a/upb/upbc/protoc-gen-upbdev.cc
+++ b/upbc/protoc-gen-upbdev.cc
@@ -32,8 +32,8 @@
 #include <string>
 
 #include "google/protobuf/compiler/plugin.upb.h"
-#include "upb/upbc/subprocess.h"
-#include "upb/upbc/upbdev.h"
+#include "upbc/subprocess.h"
+#include "upbc/upbdev.h"
 
 static constexpr char kDefaultPlugin[] = "protoc_dart_plugin";
 
diff --git a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c b/upbc/stage0/google/protobuf/compiler/plugin.upb.c
similarity index 98%
rename from upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c
rename to upbc/stage0/google/protobuf/compiler/plugin.upb.c
index 26e71c8..3a67715 100644
--- a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c
+++ b/upbc/stage0/google/protobuf/compiler/plugin.upb.c
@@ -1,5 +1,5 @@
 #include <stddef.h>
-#include "upb/upb/generated_code_support.h"
+#include "upb/generated_code_support.h"
 #include "google/protobuf/compiler/plugin.upb.h"
 
 #include "google/protobuf/descriptor.upb.h"
diff --git a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h b/upbc/stage0/google/protobuf/compiler/plugin.upb.h
similarity index 99%
rename from upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h
rename to upbc/stage0/google/protobuf/compiler/plugin.upb.h
index ffcf6f2..4227e51 100644
--- a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h
+++ b/upbc/stage0/google/protobuf/compiler/plugin.upb.h
@@ -9,10 +9,10 @@
 #ifndef GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_
 #define GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_
 
-#include "upb/upb/generated_code_support.h"
+#include "upb/generated_code_support.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -687,6 +687,6 @@
 }  /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  /* GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_ */
diff --git a/upb/upbc/subprocess.cc b/upbc/subprocess.cc
similarity index 99%
rename from upb/upbc/subprocess.cc
rename to upbc/subprocess.cc
index 7a50905..e0c2604 100644
--- a/upb/upbc/subprocess.cc
+++ b/upbc/subprocess.cc
@@ -31,7 +31,7 @@
 // Shamelessly copied from the protobuf compiler's subprocess.cc
 // except this version passes strings instead of Messages.
 
-#include "upb/upbc/subprocess.h"
+#include "upbc/subprocess.h"
 
 #include <algorithm>
 #include <cstring>
@@ -48,7 +48,7 @@
 #include "absl/strings/substitute.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 namespace upbc {
 
diff --git a/upb/upbc/subprocess.h b/upbc/subprocess.h
similarity index 100%
rename from upb/upbc/subprocess.h
rename to upbc/subprocess.h
diff --git a/upb/upbc/upbc_so.c b/upbc/upbc_so.c
similarity index 96%
rename from upb/upbc/upbc_so.c
rename to upbc/upbc_so.c
index b70f399..1cfc04b 100644
--- a/upb/upbc/upbc_so.c
+++ b/upbc/upbc_so.c
@@ -30,5 +30,5 @@
 
 // These headers form a spanning tree for the upbc defs needed by FFI layers.
 
-#include "upb/upbc/get_used_fields.h"
-#include "upb/upbc/upbdev.h"
+#include "upbc/get_used_fields.h"
+#include "upbc/upbdev.h"
diff --git a/upb/upbc/upbdev.c b/upbc/upbdev.c
similarity index 93%
rename from upb/upbc/upbdev.c
rename to upbc/upbdev.c
index b77c94e..ffccd07 100644
--- a/upb/upbc/upbdev.c
+++ b/upbc/upbdev.c
@@ -28,7 +28,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "upb/upbc/upbdev.h"
+#include "upbc/upbdev.h"
 
 #ifdef _WIN32
 #ifndef WIN32_LEAN_AND_MEAN
@@ -41,13 +41,13 @@
 
 #include "google/protobuf/compiler/plugin.upb.h"
 #include "google/protobuf/compiler/plugin.upbdefs.h"
-#include "upb/upb/base/status.h"
-#include "upb/upb/json/decode.h"
-#include "upb/upb/json/encode.h"
-#include "upb/upb/mem/arena.h"
-#include "upb/upbc/code_generator_request.h"
-#include "upb/upbc/code_generator_request.upb.h"
-#include "upb/upbc/code_generator_request.upbdefs.h"
+#include "upb/base/status.h"
+#include "upb/json/decode.h"
+#include "upb/json/encode.h"
+#include "upb/mem/arena.h"
+#include "upbc/code_generator_request.h"
+#include "upbc/code_generator_request.upb.h"
+#include "upbc/code_generator_request.upbdefs.h"
 
 static google_protobuf_compiler_CodeGeneratorResponse* upbc_JsonDecode(
     const char* data, size_t size, upb_Arena* arena, upb_Status* status) {
diff --git a/upb/upbc/upbdev.h b/upbc/upbdev.h
similarity index 94%
rename from upb/upbc/upbdev.h
rename to upbc/upbdev.h
index b6dca92..047a1be 100644
--- a/upb/upbc/upbdev.h
+++ b/upbc/upbdev.h
@@ -31,12 +31,12 @@
 #ifndef UPBC_UPBDEV_H_
 #define UPBC_UPBDEV_H_
 
-#include "upb/upb/base/status.h"
-#include "upb/upb/base/string_view.h"
-#include "upb/upb/mem/arena.h"
+#include "upb/base/status.h"
+#include "upb/base/string_view.h"
+#include "upb/mem/arena.h"
 
 // Must be last.
-#include "upb/upb/port/def.inc"
+#include "upb/port/def.inc"
 
 #ifdef __cplusplus
 extern "C" {
@@ -66,6 +66,6 @@
 } /* extern "C" */
 #endif
 
-#include "upb/upb/port/undef.inc"
+#include "upb/port/undef.inc"
 
 #endif  // UPBC_UPBDEV_H_