diff --git a/libcxx/include/__algorithm/ranges_minmax.h b/libcxx/include/__algorithm/ranges_minmax.h
--- a/libcxx/include/__algorithm/ranges_minmax.h
+++ b/libcxx/include/__algorithm/ranges_minmax.h
@@ -23,6 +23,8 @@
 #include <__iterator/projected.h>
 #include <__ranges/access.h>
 #include <__ranges/concepts.h>
+#include <__type_traits/is_reference.h>
+#include <__type_traits/remove_cvref.h>
 #include <__utility/forward.h>
 #include <__utility/move.h>
 #include <__utility/pair.h>
diff --git a/libcxx/include/__algorithm/ranges_partition_copy.h b/libcxx/include/__algorithm/ranges_partition_copy.h
--- a/libcxx/include/__algorithm/ranges_partition_copy.h
+++ b/libcxx/include/__algorithm/ranges_partition_copy.h
@@ -19,6 +19,7 @@
 #include <__ranges/access.h>
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
+#include <__type_traits/remove_cvref.h>
 #include <__utility/move.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/libcxx/include/__memory/allocator_traits.h b/libcxx/include/__memory/allocator_traits.h
--- a/libcxx/include/__memory/allocator_traits.h
+++ b/libcxx/include/__memory/allocator_traits.h
@@ -14,6 +14,7 @@
 #include <__memory/construct_at.h>
 #include <__memory/pointer_traits.h>
 #include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
 #include <__type_traits/is_copy_constructible.h>
 #include <__type_traits/is_empty.h>
 #include <__type_traits/is_move_constructible.h>
diff --git a/libcxx/include/__memory/pointer_traits.h b/libcxx/include/__memory/pointer_traits.h
--- a/libcxx/include/__memory/pointer_traits.h
+++ b/libcxx/include/__memory/pointer_traits.h
@@ -15,6 +15,7 @@
 #include <__type_traits/conditional.h>
 #include <__type_traits/conjunction.h>
 #include <__type_traits/decay.h>
+#include <__type_traits/enable_if.h>
 #include <__type_traits/is_class.h>
 #include <__type_traits/is_function.h>
 #include <__type_traits/is_void.h>
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -1922,7 +1922,12 @@
 #endif
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
-#  include <chrono>
+#  if !__has_feature(modules)
+// <chrono> creates an unbrekable module cycle from
+// <algorithm> -> <chrono> -> <format> -> <locale> ->
+// <mutex> -> <system_error> -> <string> -> <algorithm>
+#    include <chrono>
+#  endif
 #endif
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
diff --git a/libcxx/include/cuchar b/libcxx/include/cuchar
--- a/libcxx/include/cuchar
+++ b/libcxx/include/cuchar
@@ -49,6 +49,10 @@
           not be the case.
 #endif
 
+#if !defined(_LIBCPP_CXX03_LANG)
+#  include <__mbstate_t.h>  // provides ::mbstate_t
+#endif
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
@@ -57,7 +61,6 @@
 
 #if !defined(_LIBCPP_CXX03_LANG)
 
-using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
 using ::size_t _LIBCPP_USING_IF_EXISTS;
 
 #  if !defined(_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8)
diff --git a/libcxx/include/exception b/libcxx/include/exception
--- a/libcxx/include/exception
+++ b/libcxx/include/exception
@@ -81,6 +81,7 @@
 #include <__config>
 #include <__memory/addressof.h>
 #include <__type_traits/decay.h>
+#include <__type_traits/enable_if.h>
 #include <__type_traits/is_base_of.h>
 #include <__type_traits/is_class.h>
 #include <__type_traits/is_convertible.h>
@@ -378,7 +379,12 @@
 } // namespace std
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-#  include <type_traits>
+#  if !__has_feature(modules)
+// <type_traits> creates an unbrekable module cycle from
+// <type_traits> -> <__memory/allocator_traits.h> ->
+// <__memory/construct_at.h> -> <new> -> <exception> -> <type_traits>
+#    include <type_traits>
+#  endif
 #endif
 
 #endif // _LIBCPP_EXCEPTION
diff --git a/libcxx/include/limits b/libcxx/include/limits
--- a/libcxx/include/limits
+++ b/libcxx/include/limits
@@ -824,7 +824,12 @@
 _LIBCPP_POP_MACROS
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-#  include <type_traits>
+#  if !__has_feature(modules)
+// <type_traits> creates an unbrekable module cycle from
+// <type_traits> -> <__memory/allocator_traits.h> ->
+// <limits> -> <type_traits>
+#    include <type_traits>
+#  endif
 #endif
 
 #endif // _LIBCPP_LIMITS
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -1,11 +1,3 @@
-// define the module for __config outside of the top level 'std' module
-// since __config may be included from C headers which may create an
-// include cycle.
-module std_config [system] [extern_c] {
-  textual header "__config"
-  export *
-}
-
 module std [system] {
   // FIXME: The standard does not require that each of these submodules
   // re-exports its imported modules. We should provide an alternative form of
@@ -14,128 +6,94 @@
 
   // Deprecated C-compatibility headers. These can all be included from within
   // an 'extern "C"' context.
-  module depr [extern_c] {
+  module depr {
     // <assert.h> provided by C library.
     module ctype_h {
-      header "ctype.h"
-      export *
+      export std_ctype_h
     }
     module errno_h {
-      header "errno.h"
-      export *
+      export std_errno_h
     }
     module fenv_h {
-      header "fenv.h"
-      export *
+      export std_fenv_h
     }
-    // <float.h> provided by compiler or C library.
     module inttypes_h {
-      header "inttypes.h"
-      export stdint_h
-      export *
+      export std_inttypes_h
     }
     // <iso646.h> provided by compiler.
-    // <limits.h> provided by compiler or C library.
     module locale_h {
       @requires_LIBCXX_ENABLE_LOCALIZATION@
-      header "locale.h"
-      export *
+      export std_locale_h
     }
     module math_h {
-      header "math.h"
-      export *
+      export std_math_h
     }
     module setjmp_h {
-      header "setjmp.h"
-      export *
+      export std_setjmp_h
     }
     module stdatomic_h {
       @requires_LIBCXX_ENABLE_THREADS@
       requires cplusplus23
-      header "stdatomic.h"
-      export *
+      export std_stdatomic_h
     }
     // FIXME: <stdalign.h> is missing.
     // <signal.h> provided by C library.
     // <stdarg.h> provided by compiler.
     module stdbool_h {
-      // <stdbool.h>'s __bool_true_false_are_defined macro requires textual inclusion.
-      textual header "stdbool.h"
-      export *
+      export std_stdbool_h
     }
     module stddef_h {
-      // <stddef.h>'s __need_* macros require textual inclusion.
-      textual header "stddef.h"
-      export *
+      export std_stddef_h
     }
     module stdint_h {
-      header "stdint.h"
-      export *
+      export std_stdint_h
     }
     module stdio_h {
-      // <stdio.h>'s __need_* macros require textual inclusion.
-      textual header "stdio.h"
-      export *
+      export std_stdio_h
     }
     module stdlib_h {
-      // <stdlib.h>'s __need_* macros require textual inclusion.
-      textual header "stdlib.h"
-      export *
+      export std_stdlib_h
     }
     module string_h {
-      header "string.h"
-      export *
+      export std_string_h
     }
     module uchar_h {
-      header "uchar.h"
-      export *
+      export std_uchar_h
     }
     // <time.h> provided by C library.
     module wchar_h {
       @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@
-      // <wchar.h>'s __need_* macros require textual inclusion.
-      textual header "wchar.h"
-      export *
+      export std_wchar_h
     }
     module wctype_h {
       @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@
-      header "wctype.h"
-      export *
+      export std_wctype_h
     }
   }
 
   // <complex.h> and <tgmath.h> are not C headers in any real sense, do not
   // allow their use in extern "C" contexts.
   module complex_h {
-    header "complex.h"
-    export ccomplex
-    export *
+    export std_complex_h
   }
   module tgmath_h {
-    header "tgmath.h"
-    export ccomplex
-    export cmath
-    export *
+    export std_tgmath_h
   }
 
   // C compatibility headers.
   module compat {
-    module cassert {
+    module cassert [system] {
       // <cassert>'s use of NDEBUG requires textual inclusion.
       textual header "cassert"
     }
     module ccomplex {
-      header "ccomplex"
-      export complex
-      export *
+      export std_ccomplex
     }
     module cctype {
-      header "cctype"
-      export *
+      export std_cctype
     }
     module cerrno {
-      header "cerrno"
-      export *
+      export std_cerrno
     }
     module cfenv {
       header "cfenv"
@@ -155,8 +113,7 @@
       export *
     }
     module climits {
-      header "climits"
-      export *
+      export std_climits
     }
     module clocale {
       @requires_LIBCXX_ENABLE_LOCALIZATION@
@@ -164,8 +121,7 @@
       export *
     }
     module cmath {
-      header "cmath"
-      export *
+      export std_cmath
     }
     module csetjmp {
       header "csetjmp"
@@ -177,43 +133,32 @@
     }
     // FIXME: <cstdalign> is missing.
     module cstdarg {
-      header "cstdarg"
-      export *
+      export std_cstdarg
     }
     module cstdbool {
       header "cstdbool"
       export *
     }
     module cstddef {
-      header "cstddef"
-      export *
+      export std_cstddef
     }
     module cstdint {
-      header "cstdint"
-      export depr.stdint_h
-      export *
+      export std_cstdint
     }
     module cstdio {
-      header "cstdio"
-      export *
+      export std_cstdio
     }
     module cstdlib {
-      header "cstdlib"
-      export *
+      export std_cstdlib
     }
     module cstring {
-      header "cstring"
-      export *
+      export std_cstring
     }
     module ctgmath {
-      header "ctgmath"
-      export ccomplex
-      export cmath
-      export *
+      export std_ctgmath
     }
     module ctime {
-      header "ctime"
-      export *
+      export std_ctime
     }
     module cuchar {
       header "cuchar"
@@ -221,394 +166,325 @@
     }
     module cwchar {
       @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@
-      header "cwchar"
-      export depr.stdio_h
-      export *
+      export std_cwchar
     }
     module cwctype {
       @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@
-      header "cwctype"
-      export *
+      export std_cwctype
     }
   }
 
   module algorithm {
-    header "algorithm"
-    export initializer_list
-    export *
+    export std_algorithm
 
     module __algorithm {
-      module adjacent_find                   { private header "__algorithm/adjacent_find.h" }
-      module all_of                          { private header "__algorithm/all_of.h" }
-      module any_of                          { private header "__algorithm/any_of.h" }
-      module binary_search                   { private header "__algorithm/binary_search.h" }
-      module clamp                           { private header "__algorithm/clamp.h" }
-      module comp                            { private header "__algorithm/comp.h" }
-      module comp_ref_type                   { private header "__algorithm/comp_ref_type.h" }
-      module copy                            { private header "__algorithm/copy.h" }
-      module copy_backward                   { private header "__algorithm/copy_backward.h" }
-      module copy_if                         { private header "__algorithm/copy_if.h" }
-      module copy_move_common                { private header "__algorithm/copy_move_common.h" }
-      module copy_n                          { private header "__algorithm/copy_n.h" }
-      module count                           { private header "__algorithm/count.h" }
-      module count_if                        { private header "__algorithm/count_if.h" }
-      module equal                           { private header "__algorithm/equal.h" }
-      module equal_range                     { private header "__algorithm/equal_range.h" }
-      module fill                            { private header "__algorithm/fill.h" }
-      module fill_n                          { private header "__algorithm/fill_n.h" }
-      module find                            { private header "__algorithm/find.h" }
-      module find_end                        { private header "__algorithm/find_end.h" }
-      module find_first_of                   { private header "__algorithm/find_first_of.h" }
-      module find_if                         { private header "__algorithm/find_if.h" }
-      module find_if_not                     { private header "__algorithm/find_if_not.h" }
-      module for_each                        { private header "__algorithm/for_each.h" }
-      module for_each_n                      { private header "__algorithm/for_each_n.h" }
-      module generate                        { private header "__algorithm/generate.h" }
-      module generate_n                      { private header "__algorithm/generate_n.h" }
-      module half_positive                   { private header "__algorithm/half_positive.h" }
-      module in_found_result                 { private header "__algorithm/in_found_result.h" }
-      module in_fun_result                   { private header "__algorithm/in_fun_result.h" }
-      module in_in_out_result                { private header "__algorithm/in_in_out_result.h" }
-      module in_in_result                    { private header "__algorithm/in_in_result.h" }
-      module in_out_out_result               { private header "__algorithm/in_out_out_result.h" }
-      module in_out_result                   { private header "__algorithm/in_out_result.h" }
-      module includes                        { private header "__algorithm/includes.h" }
-      module inplace_merge                   { private header "__algorithm/inplace_merge.h" }
-      module is_heap                         { private header "__algorithm/is_heap.h" }
-      module is_heap_until                   { private header "__algorithm/is_heap_until.h" }
-      module is_partitioned                  { private header "__algorithm/is_partitioned.h" }
-      module is_permutation                  { private header "__algorithm/is_permutation.h" }
-      module is_sorted                       { private header "__algorithm/is_sorted.h" }
-      module is_sorted_until                 { private header "__algorithm/is_sorted_until.h" }
-      module iter_swap                       { private header "__algorithm/iter_swap.h" }
+      module adjacent_find                   { export std_algorithm.__algorithm.adjacent_find }
+      module all_of                          { export std_algorithm.__algorithm.all_of }
+      module any_of                          { export std_algorithm.__algorithm.any_of }
+      module binary_search                   { export std_algorithm.__algorithm.binary_search }
+      module clamp                           { export std_algorithm.__algorithm.clamp }
+      module comp                            { export std___algorithm_comp }
+      module comp_ref_type                   { export std___algorithm_comp_ref_type }
+      module copy                            { export std___algorithm_copy }
+      module copy_backward                   { export std_algorithm.__algorithm.copy_backward }
+      module copy_if                         { export std_algorithm.__algorithm.copy_if }
+      module copy_move_common                { export std___algorithm_copy_move_common }
+      module copy_n                          { export std___algorithm_copy_n }
+      module count                           { export std_algorithm.__algorithm.count }
+      module count_if                        { export std_algorithm.__algorithm.count_if }
+      module equal                           { export std_algorithm.__algorithm.equal }
+      module equal_range                     { export std_algorithm.__algorithm.equal_range }
+      module fill                            { export std_algorithm.__algorithm.fill }
+      module fill_n                          { export std___algorithm_fill_n }
+      module find                            { export std_algorithm.__algorithm.find }
+      module find_end                        { export std___algorithm_find_end }
+      module find_first_of                   { export std___algorithm_find_first_of }
+      module find_if                         { export std_algorithm.__algorithm.find_if }
+      module find_if_not                     { export std_algorithm.__algorithm.find_if_not }
+      module for_each                        { export std_algorithm.__algorithm.for_each }
+      module for_each_n                      { export std_algorithm.__algorithm.for_each_n }
+      module generate                        { export std_algorithm.__algorithm.generate }
+      module generate_n                      { export std_algorithm.__algorithm.generate_n }
+      module half_positive                   { export std_algorithm.__algorithm.half_positive }
+      module in_found_result                 { export std_algorithm.__algorithm.in_found_result }
+      module in_fun_result                   { export std_algorithm.__algorithm.in_fun_result }
+      module in_in_out_result                { export std_algorithm.__algorithm.in_in_out_result }
+      module in_in_result                    { export std_algorithm.__algorithm.in_in_result }
+      module in_out_out_result               { export std_algorithm.__algorithm.in_out_out_result }
+      module in_out_result                   { export std___algorithm_in_out_result }
+      module includes                        { export std_algorithm.__algorithm.includes }
+      module inplace_merge                   { export std_algorithm.__algorithm.inplace_merge }
+      module is_heap                         { export std_algorithm.__algorithm.is_heap }
+      module is_heap_until                   { export std_algorithm.__algorithm.is_heap_until }
+      module is_partitioned                  { export std_algorithm.__algorithm.is_partitioned }
+      module is_permutation                  { export std_algorithm.__algorithm.is_permutation }
+      module is_sorted                       { export std_algorithm.__algorithm.is_sorted }
+      module is_sorted_until                 { export std_algorithm.__algorithm.is_sorted_until }
+      module iter_swap                       { export std___algorithm_iter_swap }
       module iterator_operations             {
-        private header "__algorithm/iterator_operations.h"
-        export *
+        export std___algorithm_iterator_operations
       }
-      module lexicographical_compare         { private header "__algorithm/lexicographical_compare.h" }
+      module lexicographical_compare         { export std_algorithm.__algorithm.lexicographical_compare }
       module lexicographical_compare_three_way {
-        private header "__algorithm/lexicographical_compare_three_way.h"
-      }
-      module lower_bound                     { private header "__algorithm/lower_bound.h" }
-      module make_heap                       { private header "__algorithm/make_heap.h" }
-      module make_projected                  { private header "__algorithm/make_projected.h" }
-      module max                             { private header "__algorithm/max.h" }
-      module max_element                     { private header "__algorithm/max_element.h" }
-      module merge                           { private header "__algorithm/merge.h" }
-      module min                             { private header "__algorithm/min.h" }
-      module min_element                     { private header "__algorithm/min_element.h" }
-      module min_max_result                  { private header "__algorithm/min_max_result.h" }
+        export std_algorithm.__algorithm.lexicographical_compare_three_way
+      }
+      module lower_bound                     { export std_algorithm.__algorithm.lower_bound }
+      module make_heap                       { export std_algorithm.__algorithm.make_heap }
+      module make_projected                  { export std_algorithm.__algorithm.make_projected }
+      module max                             { export std___algorithm_max }
+      module max_element                     { export std___algorithm_max_element }
+      module merge                           { export std_algorithm.__algorithm.merge }
+      module min                             { export std___algorithm_min }
+      module min_element                     { export std___algorithm_min_element }
+      module min_max_result                  { export std_algorithm.__algorithm.min_max_result }
       module minmax                          {
-        private header "__algorithm/minmax.h"
-        export *
-      }
-      module minmax_element                  { private header "__algorithm/minmax_element.h" }
-      module mismatch                        { private header "__algorithm/mismatch.h" }
-      module move                            { private header "__algorithm/move.h" }
-      module move_backward                   { private header "__algorithm/move_backward.h" }
-      module next_permutation                { private header "__algorithm/next_permutation.h" }
-      module none_of                         { private header "__algorithm/none_of.h" }
-      module nth_element                     { private header "__algorithm/nth_element.h" }
-      module partial_sort                    { private header "__algorithm/partial_sort.h" }
-      module partial_sort_copy               { private header "__algorithm/partial_sort_copy.h" }
-      module partition                       { private header "__algorithm/partition.h" }
-      module partition_copy                  { private header "__algorithm/partition_copy.h" }
-      module partition_point                 { private header "__algorithm/partition_point.h" }
-      module pop_heap                        { private header "__algorithm/pop_heap.h" }
-      module prev_permutation                { private header "__algorithm/prev_permutation.h" }
-      module push_heap                       { private header "__algorithm/push_heap.h" }
-      module ranges_adjacent_find            { private header "__algorithm/ranges_adjacent_find.h" }
-      module ranges_all_of                   { private header "__algorithm/ranges_all_of.h" }
-      module ranges_any_of                   { private header "__algorithm/ranges_any_of.h" }
+        export std_algorithm.__algorithm.minmax
+      }
+      module minmax_element                  { export std_algorithm.__algorithm.minmax_element }
+      module mismatch                        { export std_algorithm.__algorithm.mismatch }
+      module move                            { export std___algorithm_move }
+      module move_backward                   { export std_algorithm.__algorithm.move_backward }
+      module next_permutation                { export std_algorithm.__algorithm.next_permutation }
+      module none_of                         { export std_algorithm.__algorithm.none_of }
+      module nth_element                     { export std_algorithm.__algorithm.nth_element }
+      module partial_sort                    { export std_algorithm.__algorithm.partial_sort }
+      module partial_sort_copy               { export std_algorithm.__algorithm.partial_sort_copy }
+      module partition                       { export std_algorithm.__algorithm.partition }
+      module partition_copy                  { export std_algorithm.__algorithm.partition_copy }
+      module partition_point                 { export std_algorithm.__algorithm.partition_point }
+      module pop_heap                        { export std_algorithm.__algorithm.pop_heap }
+      module prev_permutation                { export std_algorithm.__algorithm.prev_permutation }
+      module push_heap                       { export std_algorithm.__algorithm.push_heap }
+      module ranges_adjacent_find            { export std_algorithm.__algorithm.ranges_adjacent_find }
+      module ranges_all_of                   { export std_algorithm.__algorithm.ranges_all_of }
+      module ranges_any_of                   { export std_algorithm.__algorithm.ranges_any_of }
       module ranges_binary_search {
-        private header "__algorithm/ranges_binary_search.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_binary_search
       }
       module ranges_clamp {
-        private header "__algorithm/ranges_clamp.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_clamp
       }
       module ranges_copy {
-        private header "__algorithm/ranges_copy.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_copy
       }
       module ranges_copy_backward {
-        private header "__algorithm/ranges_copy_backward.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_copy_backward
       }
       module ranges_copy_if {
-        private header "__algorithm/ranges_copy_if.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_copy_if
       }
       module ranges_copy_n {
-        private header "__algorithm/ranges_copy_n.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_copy_n
       }
-      module ranges_count                    { private header "__algorithm/ranges_count.h" }
-      module ranges_count_if                 { private header "__algorithm/ranges_count_if.h" }
-      module ranges_equal                    { private header "__algorithm/ranges_equal.h" }
+      module ranges_count                    { export std_algorithm.__algorithm.ranges_count }
+      module ranges_count_if                 { export std_algorithm.__algorithm.ranges_count_if }
+      module ranges_equal                    { export std_algorithm.__algorithm.ranges_equal }
       module ranges_equal_range {
-        private header "__algorithm/ranges_equal_range.h"
-        export functional.__functional.ranges_operations
-      }
-      module ranges_fill                     { private header "__algorithm/ranges_fill.h" }
-      module ranges_fill_n                   { private header "__algorithm/ranges_fill_n.h" }
-      module ranges_find                     { private header "__algorithm/ranges_find.h" }
-      module ranges_find_end                 { private header "__algorithm/ranges_find_end.h" }
-      module ranges_find_first_of            { private header "__algorithm/ranges_find_first_of.h" }
-      module ranges_find_if                  { private header "__algorithm/ranges_find_if.h" }
-      module ranges_find_if_not              { private header "__algorithm/ranges_find_if_not.h" }
+        export std_algorithm.__algorithm.ranges_equal_range
+      }
+      module ranges_fill                     { export std_algorithm.__algorithm.ranges_fill }
+      module ranges_fill_n                   { export std_algorithm.__algorithm.ranges_fill_n }
+      module ranges_find                     { export std_algorithm.__algorithm.ranges_find }
+      module ranges_find_end                 { export std_algorithm.__algorithm.ranges_find_end }
+      module ranges_find_first_of            { export std_algorithm.__algorithm.ranges_find_first_of }
+      module ranges_find_if                  { export std_algorithm.__algorithm.ranges_find_if }
+      module ranges_find_if_not              { export std_algorithm.__algorithm.ranges_find_if_not }
       module ranges_for_each {
-        private header "__algorithm/ranges_for_each.h"
-        export algorithm.__algorithm.in_fun_result
+        export std_algorithm.__algorithm.ranges_for_each
       }
       module ranges_for_each_n {
-        private header "__algorithm/ranges_for_each_n.h"
-        export algorithm.__algorithm.in_fun_result
+        export std_algorithm.__algorithm.ranges_for_each_n
       }
-      module ranges_generate                 { private header "__algorithm/ranges_generate.h" }
-      module ranges_generate_n               { private header "__algorithm/ranges_generate_n.h" }
+      module ranges_generate                 { export std_algorithm.__algorithm.ranges_generate }
+      module ranges_generate_n               { export std_algorithm.__algorithm.ranges_generate_n }
       module ranges_includes {
-        private header "__algorithm/ranges_includes.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_includes
       }
       module ranges_inplace_merge {
-        private header "__algorithm/ranges_inplace_merge.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_inplace_merge
       }
       module ranges_is_heap {
-        private header "__algorithm/ranges_is_heap.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_is_heap
       }
       module ranges_is_heap_until {
-        private header "__algorithm/ranges_is_heap_until.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_is_heap_until
       }
-      module ranges_is_partitioned           { private header "__algorithm/ranges_is_partitioned.h" }
-      module ranges_is_permutation           { private header "__algorithm/ranges_is_permutation.h" }
+      module ranges_is_partitioned           { export std_algorithm.__algorithm.ranges_is_partitioned }
+      module ranges_is_permutation           { export std_algorithm.__algorithm.ranges_is_permutation }
       module ranges_is_sorted {
-        private header "__algorithm/ranges_is_sorted.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_is_sorted
       }
       module ranges_is_sorted_until {
-        private header "__algorithm/ranges_is_sorted_until.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_is_sorted_until
       }
-      module ranges_iterator_concept         { private header "__algorithm/ranges_iterator_concept.h" }
+      module ranges_iterator_concept         { export std___algorithm_ranges_iterator_concept }
       module ranges_lexicographical_compare {
-        private header "__algorithm/ranges_lexicographical_compare.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_lexicographical_compare
       }
       module ranges_lower_bound {
-        private header "__algorithm/ranges_lower_bound.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_lower_bound
       }
       module ranges_make_heap {
-        private header "__algorithm/ranges_make_heap.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_make_heap
       }
       module ranges_max {
-        private header "__algorithm/ranges_max.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_max
       }
       module ranges_max_element {
-        private header "__algorithm/ranges_max_element.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_max_element
       }
       module ranges_merge {
-        private header "__algorithm/ranges_merge.h"
-        export algorithm.__algorithm.in_in_out_result
+        export std_algorithm.__algorithm.ranges_merge
       }
       module ranges_min {
-        private header "__algorithm/ranges_min.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_min
       }
       module ranges_min_element {
-        private header "__algorithm/ranges_min_element.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_min_element
       }
       module ranges_minmax {
-        private header "__algorithm/ranges_minmax.h"
-        export functional.__functional.ranges_operations
-        export algorithm.__algorithm.min_max_result
+        export std_algorithm.__algorithm.ranges_minmax
       }
       module ranges_minmax_element {
-        private header "__algorithm/ranges_minmax_element.h"
-        export functional.__functional.ranges_operations
-        export algorithm.__algorithm.min_max_result
+        export std_algorithm.__algorithm.ranges_minmax_element
       }
       module ranges_mismatch {
-        private header "__algorithm/ranges_mismatch.h"
-        export algorithm.__algorithm.in_in_result
+        export std_algorithm.__algorithm.ranges_mismatch
       }
       module ranges_move {
-        private header "__algorithm/ranges_move.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_move
       }
       module ranges_move_backward {
-        private header "__algorithm/ranges_move_backward.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_move_backward
       }
       module ranges_next_permutation {
-        private header "__algorithm/ranges_next_permutation.h"
-        export algorithm.__algorithm.in_found_result
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_next_permutation
       }
-      module ranges_none_of                  { private header "__algorithm/ranges_none_of.h" }
+      module ranges_none_of                  { export std_algorithm.__algorithm.ranges_none_of }
       module ranges_nth_element {
-        private header "__algorithm/ranges_nth_element.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_nth_element
       }
       module ranges_partial_sort {
-        private header "__algorithm/ranges_partial_sort.h"
-        export algorithm.__algorithm.in_out_result
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_partial_sort
       }
       module ranges_partial_sort_copy {
-        private header "__algorithm/ranges_partial_sort_copy.h"
-        export algorithm.__algorithm.in_out_out_result
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_partial_sort_copy
       }
-      module ranges_partition                { private header "__algorithm/ranges_partition.h" }
-      module ranges_partition_copy           { private header "__algorithm/ranges_partition_copy.h" }
-      module ranges_partition_point          { private header "__algorithm/ranges_partition_point.h" }
+      module ranges_partition                { export std_algorithm.__algorithm.ranges_partition }
+      module ranges_partition_copy           { export std_algorithm.__algorithm.ranges_partition_copy }
+      module ranges_partition_point          { export std_algorithm.__algorithm.ranges_partition_point }
       module ranges_pop_heap {
-        private header "__algorithm/ranges_pop_heap.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_pop_heap
       }
       module ranges_prev_permutation {
-        private header "__algorithm/ranges_prev_permutation.h"
-        export algorithm.__algorithm.in_found_result
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_prev_permutation
       }
       module ranges_push_heap {
-        private header "__algorithm/ranges_push_heap.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_push_heap
       }
-      module ranges_remove                   { private header "__algorithm/ranges_remove.h" }
+      module ranges_remove                   { export std_algorithm.__algorithm.ranges_remove }
       module ranges_remove_copy {
-        private header "__algorithm/ranges_remove_copy.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_remove_copy
       }
       module ranges_remove_copy_if {
-        private header "__algorithm/ranges_remove_copy_if.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_remove_copy_if
       }
-      module ranges_remove_if                { private header "__algorithm/ranges_remove_if.h" }
-      module ranges_replace                  { private header "__algorithm/ranges_replace.h" }
+      module ranges_remove_if                { export std_algorithm.__algorithm.ranges_remove_if }
+      module ranges_replace                  { export std_algorithm.__algorithm.ranges_replace }
       module ranges_replace_copy {
-        private header "__algorithm/ranges_replace_copy.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_replace_copy
       }
       module ranges_replace_copy_if {
-        private header "__algorithm/ranges_replace_copy_if.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_replace_copy_if
       }
-      module ranges_replace_if               { private header "__algorithm/ranges_replace_if.h" }
-      module ranges_reverse                  { private header "__algorithm/ranges_reverse.h" }
+      module ranges_replace_if               { export std_algorithm.__algorithm.ranges_replace_if }
+      module ranges_reverse                  { export std_algorithm.__algorithm.ranges_reverse }
       module ranges_reverse_copy {
-        private header "__algorithm/ranges_reverse_copy.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_reverse_copy
       }
-      module ranges_rotate                   { private header "__algorithm/ranges_rotate.h" }
+      module ranges_rotate                   { export std_algorithm.__algorithm.ranges_rotate }
       module ranges_rotate_copy {
-        private header "__algorithm/ranges_rotate_copy.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_rotate_copy
       }
-      module ranges_sample                   { private header "__algorithm/ranges_sample.h" }
-      module ranges_search                   { private header "__algorithm/ranges_search.h" }
-      module ranges_search_n                 { private header "__algorithm/ranges_search_n.h" }
+      module ranges_sample                   { export std_algorithm.__algorithm.ranges_sample }
+      module ranges_search                   { export std_algorithm.__algorithm.ranges_search }
+      module ranges_search_n                 { export std_algorithm.__algorithm.ranges_search_n }
       module ranges_set_difference {
-        private header "__algorithm/ranges_set_difference.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_set_difference
       }
       module ranges_set_intersection {
-        private header "__algorithm/ranges_set_intersection.h"
-        export algorithm.__algorithm.in_in_out_result
+        export std_algorithm.__algorithm.ranges_set_intersection
       }
       module ranges_set_symmetric_difference {
-        private header "__algorithm/ranges_set_symmetric_difference.h"
-        export algorithm.__algorithm.in_in_out_result
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_set_symmetric_difference
       }
       module ranges_set_union {
-        private header "__algorithm/ranges_set_union.h"
-        export algorithm.__algorithm.in_in_out_result
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_set_union
       }
-      module ranges_shuffle                  { private header "__algorithm/ranges_shuffle.h" }
+      module ranges_shuffle                  { export std_algorithm.__algorithm.ranges_shuffle }
       module ranges_sort {
-        private header "__algorithm/ranges_sort.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_sort
       }
       module ranges_sort_heap {
-        private header "__algorithm/ranges_sort_heap.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_sort_heap
       }
-      module ranges_stable_partition         { private header "__algorithm/ranges_stable_partition.h" }
+      module ranges_stable_partition         { export std_algorithm.__algorithm.ranges_stable_partition }
       module ranges_stable_sort {
-        private header "__algorithm/ranges_stable_sort.h"
-        export functional.__functional.ranges_operations
+        export std_algorithm.__algorithm.ranges_stable_sort
       }
       module ranges_swap_ranges {
-        private header "__algorithm/ranges_swap_ranges.h"
-        export algorithm.__algorithm.in_in_result
+        export std_algorithm.__algorithm.ranges_swap_ranges
       }
       module ranges_transform {
-        private header "__algorithm/ranges_transform.h"
-        export algorithm.__algorithm.in_in_out_result
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_transform
       }
       module uniform_random_bit_generator_adaptor {
-        private header "__algorithm/uniform_random_bit_generator_adaptor.h"
+        export std_algorithm.__algorithm.uniform_random_bit_generator_adaptor
       }
-      module ranges_unique                   { private header "__algorithm/ranges_unique.h" }
+      module ranges_unique                   { export std_algorithm.__algorithm.ranges_unique }
       module ranges_unique_copy {
-        private header "__algorithm/ranges_unique_copy.h"
-        export algorithm.__algorithm.in_out_result
+        export std_algorithm.__algorithm.ranges_unique_copy
       }
       module ranges_upper_bound {
-        private header "__algorithm/ranges_upper_bound.h"
-        export functional.__functional.ranges_operations
-      }
-      module remove                          { private header "__algorithm/remove.h" }
-      module remove_copy                     { private header "__algorithm/remove_copy.h" }
-      module remove_copy_if                  { private header "__algorithm/remove_copy_if.h" }
-      module remove_if                       { private header "__algorithm/remove_if.h" }
-      module replace                         { private header "__algorithm/replace.h" }
-      module replace_copy                    { private header "__algorithm/replace_copy.h" }
-      module replace_copy_if                 { private header "__algorithm/replace_copy_if.h" }
-      module replace_if                      { private header "__algorithm/replace_if.h" }
-      module reverse                         { private header "__algorithm/reverse.h" }
-      module reverse_copy                    { private header "__algorithm/reverse_copy.h" }
-      module rotate                          { private header "__algorithm/rotate.h" }
-      module rotate_copy                     { private header "__algorithm/rotate_copy.h" }
-      module sample                          { private header "__algorithm/sample.h" }
-      module search                          { private header "__algorithm/search.h" }
-      module search_n                        { private header "__algorithm/search_n.h" }
-      module set_difference                  { private header "__algorithm/set_difference.h" }
-      module set_intersection                { private header "__algorithm/set_intersection.h" }
-      module set_symmetric_difference        { private header "__algorithm/set_symmetric_difference.h" }
-      module set_union                       { private header "__algorithm/set_union.h" }
-      module shift_left                      { private header "__algorithm/shift_left.h" }
-      module shift_right                     { private header "__algorithm/shift_right.h" }
-      module shuffle                         { private header "__algorithm/shuffle.h" }
-      module sift_down                       { private header "__algorithm/sift_down.h" }
-      module sort                            { private header "__algorithm/sort.h" }
-      module sort_heap                       { private header "__algorithm/sort_heap.h" }
-      module stable_partition                { private header "__algorithm/stable_partition.h" }
-      module stable_sort                     { private header "__algorithm/stable_sort.h" }
-      module swap_ranges                     { private header "__algorithm/swap_ranges.h" }
-      module three_way_comp_ref_type         { private header "__algorithm/three_way_comp_ref_type.h" }
-      module transform                       { private header "__algorithm/transform.h" }
-      module unique                          { private header "__algorithm/unique.h" }
-      module unique_copy                     { private header "__algorithm/unique_copy.h" }
-      module unwrap_iter                     { private header "__algorithm/unwrap_iter.h" }
-      module unwrap_range {
-        private header "__algorithm/unwrap_range.h"
-        export utility.__utility.pair
-      }
-      module upper_bound                     { private header "__algorithm/upper_bound.h" }
+        export std_algorithm.__algorithm.ranges_upper_bound
+      }
+      module remove                          { export std_algorithm.__algorithm.remove }
+      module remove_copy                     { export std_algorithm.__algorithm.remove_copy }
+      module remove_copy_if                  { export std_algorithm.__algorithm.remove_copy_if }
+      module remove_if                       { export std_algorithm.__algorithm.remove_if }
+      module replace                         { export std_algorithm.__algorithm.replace }
+      module replace_copy                    { export std_algorithm.__algorithm.replace_copy }
+      module replace_copy_if                 { export std_algorithm.__algorithm.replace_copy_if }
+      module replace_if                      { export std_algorithm.__algorithm.replace_if }
+      module reverse                         { export std_algorithm.__algorithm.reverse }
+      module reverse_copy                    { export std_algorithm.__algorithm.reverse_copy }
+      module rotate                          { export std_algorithm.__algorithm.rotate }
+      module rotate_copy                     { export std_algorithm.__algorithm.rotate_copy }
+      module sample                          { export std_algorithm.__algorithm.sample }
+      module search                          { export std___algorithm_search }
+      module search_n                        { export std_algorithm.__algorithm.search_n }
+      module set_difference                  { export std_algorithm.__algorithm.set_difference }
+      module set_intersection                { export std_algorithm.__algorithm.set_intersection }
+      module set_symmetric_difference        { export std_algorithm.__algorithm.set_symmetric_difference }
+      module set_union                       { export std_algorithm.__algorithm.set_union }
+      module shift_left                      { export std_algorithm.__algorithm.shift_left }
+      module shift_right                     { export std_algorithm.__algorithm.shift_right }
+      module shuffle                         { export std_algorithm.__algorithm.shuffle }
+      module sift_down                       { export std_algorithm.__algorithm.sift_down }
+      module sort                            { export std_algorithm.__algorithm.sort }
+      module sort_heap                       { export std_algorithm.__algorithm.sort_heap }
+      module stable_partition                { export std_algorithm.__algorithm.stable_partition }
+      module stable_sort                     { export std_algorithm.__algorithm.stable_sort }
+      module swap_ranges                     { export std_algorithm.__algorithm.swap_ranges }
+      module three_way_comp_ref_type         { export std_algorithm.__algorithm.three_way_comp_ref_type }
+      module transform                       { export std_algorithm.__algorithm.transform }
+      module unique                          { export std_algorithm.__algorithm.unique }
+      module unique_copy                     { export std_algorithm.__algorithm.unique_copy }
+      module unwrap_iter                     { export std___algorithm_unwrap_iter }
+      module unwrap_range                    {
+        export std___algorithm_unwrap_range
+      }
+      module upper_bound                     { export std_algorithm.__algorithm.upper_bound }
     }
   }
   module any {
@@ -616,31 +492,28 @@
     export *
   }
   module array {
-    header "array"
-    export initializer_list
-    export *
+    export std_array
 
-    module array_fwd { private header "__fwd/array.h" }
+    module array_fwd { export std___array_array_fwd }
   }
   module atomic {
-    header "atomic"
-    export *
+    export std_atomic
 
     module __atomic {
-      module aliases             { private header "__atomic/aliases.h" }
-      module atomic              { private header "__atomic/atomic.h" }
-      module atomic_base         { private header "__atomic/atomic_base.h" }
-      module atomic_flag         { private header "__atomic/atomic_flag.h" }
-      module atomic_init         { private header "__atomic/atomic_init.h" }
-      module atomic_lock_free    { private header "__atomic/atomic_lock_free.h" }
-      module atomic_sync         { private header "__atomic/atomic_sync.h" }
-      module check_memory_order  { private header "__atomic/check_memory_order.h" }
-      module contention_t        { private header "__atomic/contention_t.h" }
-      module cxx_atomic_impl     { private header "__atomic/cxx_atomic_impl.h" }
-      module fence               { private header "__atomic/fence.h" }
-      module is_always_lock_free { private header "__atomic/is_always_lock_free.h" }
-      module kill_dependency     { private header "__atomic/kill_dependency.h" }
-      module memory_order        { private header "__atomic/memory_order.h" }
+      module aliases             { export std_atomic.__atomic.aliases }
+      module atomic              { export std_atomic.__atomic.atomic }
+      module atomic_base         { export std_atomic.__atomic.atomic_base }
+      module atomic_flag         { export std_atomic.__atomic.atomic_flag }
+      module atomic_init         { export std_atomic.__atomic.atomic_init }
+      module atomic_lock_free    { export std_atomic.__atomic.atomic_lock_free }
+      module atomic_sync         { export std_atomic.__atomic.atomic_sync }
+      module check_memory_order  { export std_atomic.__atomic.check_memory_order }
+      module contention_t        { export std_atomic.__atomic.contention_t }
+      module cxx_atomic_impl     { export std_atomic.__atomic.cxx_atomic_impl }
+      module fence               { export std_atomic.__atomic.fence }
+      module is_always_lock_free { export std_atomic.__atomic.is_always_lock_free }
+      module kill_dependency     { export std_atomic.__atomic.kill_dependency }
+      module memory_order        { export std_atomic.__atomic.memory_order }
     }
   }
   module barrier {
@@ -649,89 +522,79 @@
     export *
   }
   module bit {
-    header "bit"
-    export *
+    export std_bit
 
     module __bit {
-      module bit_cast       { private header "__bit/bit_cast.h" }
-      module bit_ceil       { private header "__bit/bit_ceil.h" }
-      module bit_floor      { private header "__bit/bit_floor.h" }
-      module bit_log2       { private header "__bit/bit_log2.h" }
-      module bit_width      { private header "__bit/bit_width.h" }
-      module blsr           { private header "__bit/blsr.h" }
-      module byteswap       { private header "__bit/byteswap.h" }
-      module countl         { private header "__bit/countl.h" }
-      module countr         { private header "__bit/countr.h" }
-      module endian         { private header "__bit/endian.h" }
-      module has_single_bit { private header "__bit/has_single_bit.h" }
-      module popcount       { private header "__bit/popcount.h" }
-      module rotate         { private header "__bit/rotate.h" }
+      module bit_cast       { export std_bit.__bit.bit_cast }
+      module bit_ceil       { export std_bit.__bit.bit_ceil }
+      module bit_floor      { export std_bit.__bit.bit_floor }
+      module bit_log2       { export std_bit.__bit.bit_log2 }
+      module bit_width      { export std_bit.__bit.bit_width }
+      module blsr           { export std_bit.__bit.blsr }
+      module byteswap       { export std_bit.__bit.byteswap }
+      module countl         { export std_bit.__bit.countl }
+      module countr         { export std_bit.__bit.countr }
+      module endian         { export std_bit.__bit.endian }
+      module has_single_bit { export std_bit.__bit.has_single_bit }
+      module popcount       { export std_bit.__bit.popcount }
+      module rotate         { export std_bit.__bit.rotate }
     }
   }
   module bitset {
-    header "bitset"
-    export string
-    export iosfwd
-    export *
+    export std_bitset
   }
-  // No submodule for cassert. It fundamentally needs repeated, textual inclusion.
   module charconv {
-    header "charconv"
-    export *
+    export std_charconv
 
     module __charconv {
-      module chars_format      { private header "__charconv/chars_format.h" }
-      module from_chars_result { private header "__charconv/from_chars_result.h" }
-      module tables            { private header "__charconv/tables.h" }
-      module to_chars_base_10  { private header "__charconv/to_chars_base_10.h" }
-      module to_chars_result   { private header "__charconv/to_chars_result.h" }
+      module chars_format      { export std_charconv.__charconv.chars_format }
+      module from_chars_result { export std_charconv.__charconv.from_chars_result }
+      module tables            { export std_charconv.__charconv.tables }
+      module to_chars_base_10  { export std_charconv.__charconv.to_chars_base_10 }
+      module to_chars_result   { export std_charconv.__charconv.to_chars_result }
     }
 
   }
   module chrono {
-    header "chrono"
-    export *
+    export std_chrono
 
     module __chrono {
-      module calendar               { private header "__chrono/calendar.h" }
-      module concepts               { private header "__chrono/concepts.h" }
-      module convert_to_timespec    { private header "__chrono/convert_to_timespec.h" }
-      module convert_to_tm          { private header "__chrono/convert_to_tm.h" }
-      module day                    { private header "__chrono/day.h" }
-      module duration               { private header "__chrono/duration.h" }
-      module file_clock             { private header "__chrono/file_clock.h" }
+      module calendar               { export std_chrono.__chrono.calendar }
+      module concepts               { export std_chrono.__chrono.concepts }
+      module convert_to_timespec    { export std___chrono_convert_to_timespec }
+      module convert_to_tm          { export std_chrono.__chrono.convert_to_tm }
+      module day                    { export std_chrono.__chrono.day }
+      module duration               { export std___chrono_duration }
+      module file_clock             { export std_chrono.__chrono.file_clock }
       module formatter              {
         @requires_LIBCXX_ENABLE_LOCALIZATION@
-        private header "__chrono/formatter.h"
+        export std_chrono.__chrono.formatter
       }
-      module hh_mm_ss               { private header "__chrono/hh_mm_ss.h" }
+      module hh_mm_ss               { export std_chrono.__chrono.hh_mm_ss }
       module high_resolution_clock  {
-        private header "__chrono/high_resolution_clock.h"
-        export steady_clock
-        export system_clock
-        export time_point
-      }
-      module literals               { private header "__chrono/literals.h" }
-      module month                  { private header "__chrono/month.h" }
-      module month_weekday          { private header "__chrono/month_weekday.h" }
-      module monthday               { private header "__chrono/monthday.h" }
+        export std___chrono_high_resolution_clock
+      }
+      module literals               { export std_chrono.__chrono.literals }
+      module month                  { export std_chrono.__chrono.month }
+      module month_weekday          { export std_chrono.__chrono.month_weekday }
+      module monthday               { export std_chrono.__chrono.monthday }
       module ostream                {
         @requires_LIBCXX_ENABLE_LOCALIZATION@
-        private header "__chrono/ostream.h"
+        export std_chrono.__chrono.ostream
       }
       module parser_std_format_spec {
         @requires_LIBCXX_ENABLE_LOCALIZATION@
-        private header "__chrono/parser_std_format_spec.h"
+        export std_chrono.__chrono.parser_std_format_spec
       }
-      module statically_widen       { private header "__chrono/statically_widen.h" }
-      module steady_clock           { private header "__chrono/steady_clock.h" }
-      module system_clock           { private header "__chrono/system_clock.h" }
-      module time_point             { private header "__chrono/time_point.h" }
-      module weekday                { private header "__chrono/weekday.h" }
-      module year                   { private header "__chrono/year.h" }
-      module year_month             { private header "__chrono/year_month.h" }
-      module year_month_day         { private header "__chrono/year_month_day.h" }
-      module year_month_weekday     { private header "__chrono/year_month_weekday.h" }
+      module statically_widen       { export std___chrono_statically_widen }
+      module steady_clock           { export std___chrono_steady_clock }
+      module system_clock           { export std___chrono_system_clock }
+      module time_point             { export std___chrono_time_point }
+      module weekday                { export std_chrono.__chrono.weekday }
+      module year                   { export std_chrono.__chrono.year }
+      module year_month             { export std_chrono.__chrono.year_month }
+      module year_month_day         { export std_chrono.__chrono.year_month_day }
+      module year_month_weekday     { export std_chrono.__chrono.year_month_weekday }
     }
   }
   module codecvt {
@@ -740,62 +603,57 @@
     export *
   }
   module compare {
-    header "compare"
-    export *
+    export std_compare
 
     module __compare {
-      module common_comparison_category     { private header "__compare/common_comparison_category.h" }
-      module compare_partial_order_fallback { private header "__compare/compare_partial_order_fallback.h" }
-      module compare_strong_order_fallback  { private header "__compare/compare_strong_order_fallback.h" }
-      module compare_three_way              { private header "__compare/compare_three_way.h" }
-      module compare_three_way_result       { private header "__compare/compare_three_way_result.h" }
-      module compare_weak_order_fallback    { private header "__compare/compare_weak_order_fallback.h" }
-      module is_eq                          { private header "__compare/is_eq.h" }
-      module ordering                       { private header "__compare/ordering.h" }
-      module partial_order                  { private header "__compare/partial_order.h" }
-      module strong_order                   { private header "__compare/strong_order.h" }
-      module synth_three_way                { private header "__compare/synth_three_way.h" }
-      module three_way_comparable           { private header "__compare/three_way_comparable.h" }
-      module weak_order                     { private header "__compare/weak_order.h" }
+      module common_comparison_category     { export std_compare.__compare.common_comparison_category }
+      module compare_partial_order_fallback { export std_compare.__compare.compare_partial_order_fallback }
+      module compare_strong_order_fallback  { export std_compare.__compare.compare_strong_order_fallback }
+      module compare_three_way              { export std_compare.__compare.compare_three_way }
+      module compare_three_way_result       { export std_compare.__compare.compare_three_way_result }
+      module compare_weak_order_fallback    { export std_compare.__compare.compare_weak_order_fallback }
+      module is_eq                          { export std_compare.__compare.is_eq }
+      module ordering                       { export std_compare.__compare.ordering }
+      module partial_order                  { export std_compare.__compare.partial_order }
+      module strong_order                   { export std_compare.__compare.strong_order }
+      module synth_three_way                { export std_compare.__compare.synth_three_way }
+      module three_way_comparable           { export std_compare.__compare.three_way_comparable }
+      module weak_order                     { export std_compare.__compare.weak_order }
     }
   }
   module complex {
-    header "complex"
-    export *
+    export std_complex
   }
   module concepts {
-    header "concepts"
-    export *
+    export std_concepts
 
     module __concepts {
-      module arithmetic                 { private header "__concepts/arithmetic.h" }
-      module assignable                 { private header "__concepts/assignable.h" }
-      module boolean_testable           { private header "__concepts/boolean_testable.h" }
-      module class_or_enum              { private header "__concepts/class_or_enum.h" }
-      module common_reference_with      { private header "__concepts/common_reference_with.h" }
-      module common_with                { private header "__concepts/common_with.h" }
-      module constructible              { private header "__concepts/constructible.h" }
-      module convertible_to             { private header "__concepts/convertible_to.h" }
-      module copyable                   { private header "__concepts/copyable.h" }
-      module derived_from               { private header "__concepts/derived_from.h" }
-      module destructible               { private header "__concepts/destructible.h" }
-      module different_from             { private header "__concepts/different_from.h" }
-      module equality_comparable {
-        private header "__concepts/equality_comparable.h"
-        export type_traits.common_reference
-      }
-      module invocable                  { private header "__concepts/invocable.h" }
-      module movable                    { private header "__concepts/movable.h" }
-      module predicate                  { private header "__concepts/predicate.h" }
-      module regular                    { private header "__concepts/regular.h" }
-      module relation                   { private header "__concepts/relation.h" }
-      module same_as {
-        private header "__concepts/same_as.h"
-        export type_traits.is_same
-      }
-      module semiregular                { private header "__concepts/semiregular.h" }
-      module swappable                  { private header "__concepts/swappable.h" }
-      module totally_ordered            { private header "__concepts/totally_ordered.h" }
+      module arithmetic                 { export std_concepts.__concepts.arithmetic }
+      module assignable                 { export std_concepts.__concepts.assignable }
+      module boolean_testable           { export std_concepts.__concepts.boolean_testable }
+      module class_or_enum              { export std_concepts.__concepts.class_or_enum }
+      module common_reference_with      { export std_concepts.__concepts.common_reference_with }
+      module common_with                { export std_concepts.__concepts.common_with }
+      module constructible              { export std_concepts.__concepts.constructible }
+      module convertible_to             { export std_concepts.__concepts.convertible_to }
+      module copyable                   { export std_concepts.__concepts.copyable }
+      module derived_from               { export std_concepts.__concepts.derived_from }
+      module destructible               { export std_concepts.__concepts.destructible }
+      module different_from             { export std_concepts.__concepts.different_from }
+      module equality_comparable        {
+        export std_concepts.__concepts.equality_comparable
+      }
+      module invocable                  { export std_concepts.__concepts.invocable }
+      module movable                    { export std_concepts.__concepts.movable }
+      module predicate                  { export std_concepts.__concepts.predicate }
+      module regular                    { export std_concepts.__concepts.regular }
+      module relation                   { export std_concepts.__concepts.relation }
+      module same_as                    {
+        export std_concepts.__concepts.same_as
+      }
+      module semiregular                { export std_concepts.__concepts.semiregular }
+      module swappable                  { export std_concepts.__concepts.swappable }
+      module totally_ordered            { export std_concepts.__concepts.totally_ordered }
     }
   }
   module condition_variable {
@@ -815,13 +673,10 @@
     }
   }
   module deque {
-    header "deque"
-    export initializer_list
-    export *
+    export std_deque
   }
   module exception {
-    header "exception"
-    export *
+    export std_exception
   }
   module execution {
     header "execution"
@@ -863,50 +718,45 @@
     }
   }
   module format {
-    header "format"
-    export *
+    export std_format
 
     module __format {
-      module buffer                          { private header "__format/buffer.h" }
-      module concepts                        { private header "__format/concepts.h" }
-      module container_adaptor               { private header "__format/container_adaptor.h" }
-      module enable_insertable               { private header "__format/enable_insertable.h" }
-      module escaped_output_table            { private header "__format/escaped_output_table.h" }
-      module extended_grapheme_cluster_table { private header "__format/extended_grapheme_cluster_table.h" }
-      module format_arg                      { private header "__format/format_arg.h" }
-      module format_arg_store                { private header "__format/format_arg_store.h" }
-      module format_args                     { private header "__format/format_args.h" }
+      module buffer                          { export std_format.__format.buffer }
+      module concepts                        { export std___format_concepts }
+      module container_adaptor               { export std_format.__format.container_adaptor }
+      module enable_insertable               { export std___format_enable_insertable }
+      module escaped_output_table            { export std_format.__format.escaped_output_table }
+      module extended_grapheme_cluster_table { export std_format.__format.extended_grapheme_cluster_table }
+      module format_arg                      { export std_format.__format.format_arg }
+      module format_arg_store                { export std_format.__format.format_arg_store }
+      module format_args                     { export std_format.__format.format_args }
       module format_context {
-        private header "__format/format_context.h"
-        export optional
-        export locale
+        export std_format.__format.format_context
       }
-      module format_error                    { private header "__format/format_error.h" }
+      module format_error                    { export std___format_format_error }
       module format_functions                {
-        private header "__format/format_functions.h"
-        export string
+        export std_format.__format.format_functions
       }
-      module format_fwd                      { private header "__format/format_fwd.h" }
-      module format_parse_context            { private header "__format/format_parse_context.h" }
-      module format_string                   { private header "__format/format_string.h" }
+      module format_fwd                      { export std___format_format_fwd }
+      module format_parse_context            { export std___format_format_parse_context }
+      module format_string                   { export std_format.__format.format_string }
       module format_to_n_result {
-        private header "__format/format_to_n_result.h"
-        export iterator.__iterator.incrementable_traits
-      }
-      module formatter                       { private header "__format/formatter.h" }
-      module formatter_bool                  { private header "__format/formatter_bool.h" }
-      module formatter_char                  { private header "__format/formatter_char.h" }
-      module formatter_floating_point        { private header "__format/formatter_floating_point.h" }
-      module formatter_integer               { private header "__format/formatter_integer.h" }
-      module formatter_integral              { private header "__format/formatter_integral.h" }
-      module formatter_output                { private header "__format/formatter_output.h" }
-      module formatter_pointer               { private header "__format/formatter_pointer.h" }
-      module formatter_string                { private header "__format/formatter_string.h" }
-      module formatter_tuple                 { private header "__format/formatter_tuple.h" }
-      module parser_std_format_spec          { private header "__format/parser_std_format_spec.h" }
-      module range_default_formatter         { private header "__format/range_default_formatter.h" }
-      module range_formatter                 { private header "__format/range_formatter.h" }
-      module unicode                         { private header "__format/unicode.h" }
+        export std_format.__format.format_to_n_result
+      }
+      module formatter                       { export std___format_formatter }
+      module formatter_bool                  { export std_format.__format.formatter_bool }
+      module formatter_char                  { export std_format.__format.formatter_char }
+      module formatter_floating_point        { export std_format.__format.formatter_floating_point }
+      module formatter_integer               { export std_format.__format.formatter_integer }
+      module formatter_integral              { export std_format.__format.formatter_integral }
+      module formatter_output                { export std_format.__format.formatter_output }
+      module formatter_pointer               { export std_format.__format.formatter_pointer }
+      module formatter_string                { export std_format.__format.formatter_string }
+      module formatter_tuple                 { export std_format.__format.formatter_tuple }
+      module parser_std_format_spec          { export std_format.__format.parser_std_format_spec }
+      module range_default_formatter         { export std_format.__format.range_default_formatter }
+      module range_formatter                 { export std_format.__format.range_formatter }
+      module unicode                         { export std_format.__format.unicode }
     }
   }
   module forward_list {
@@ -921,42 +771,40 @@
     export *
   }
   module functional {
-    header "functional"
-    export *
+    export std_functional
 
     module __functional {
-      module binary_function            { private header "__functional/binary_function.h" }
-      module binary_negate              { private header "__functional/binary_negate.h" }
-      module bind                       { private header "__functional/bind.h" }
-      module bind_back                  { private header "__functional/bind_back.h" }
-      module bind_front                 { private header "__functional/bind_front.h" }
-      module binder1st                  { private header "__functional/binder1st.h" }
-      module binder2nd                  { private header "__functional/binder2nd.h" }
-      module boyer_moore_searcher       { private header "__functional/boyer_moore_searcher.h" }
-      module compose                    { private header "__functional/compose.h" }
-      module default_searcher           { private header "__functional/default_searcher.h" }
-      module function                   { private header "__functional/function.h" }
-      module hash                       { private header "__functional/hash.h" }
-      module hash_fwd                   { private header "__fwd/hash.h" }
-      module identity                   { private header "__functional/identity.h" }
+      module binary_function            { export std___functional_binary_function }
+      module binary_negate              { export std_functional.__functional.binary_negate }
+      module bind                       { export std_functional.__functional.bind }
+      module bind_back                  { export std_functional.__functional.bind_back }
+      module bind_front                 { export std_functional.__functional.bind_front }
+      module binder1st                  { export std_functional.__functional.binder1st }
+      module binder2nd                  { export std_functional.__functional.binder2nd }
+      module boyer_moore_searcher       { export std_functional.__functional.boyer_moore_searcher }
+      module compose                    { export std_functional.__functional.compose }
+      module default_searcher           { export std_functional.__functional.default_searcher }
+      module function                   { export std_functional.__functional.function }
+      module hash                       { export std___functional_hash }
+      module hash_fwd                   { export std___functional_hash_fwd }
+      module identity                   { export std___functional_identity }
       module invoke                     {
-        private header "__functional/invoke.h"
-        export type_traits
-      }
-      module is_transparent             { private header "__functional/is_transparent.h" }
-      module mem_fn                     { private header "__functional/mem_fn.h" }
-      module mem_fun_ref                { private header "__functional/mem_fun_ref.h" }
-      module not_fn                     { private header "__functional/not_fn.h" }
-      module operations                 { private header "__functional/operations.h" }
-      module perfect_forward            { private header "__functional/perfect_forward.h" }
-      module pointer_to_binary_function { private header "__functional/pointer_to_binary_function.h" }
-      module pointer_to_unary_function  { private header "__functional/pointer_to_unary_function.h" }
-      module ranges_operations          { private header "__functional/ranges_operations.h" }
-      module reference_wrapper          { private header "__functional/reference_wrapper.h" }
-      module unary_function             { private header "__functional/unary_function.h" }
-      module unary_negate               { private header "__functional/unary_negate.h" }
-      module unwrap_ref                 { private header "__functional/unwrap_ref.h" }
-      module weak_result_type           { private header "__functional/weak_result_type.h" }
+        export std___functional_invoke
+      }
+      module is_transparent             { export std___functional_is_transparent }
+      module mem_fn                     { export std_functional.__functional.mem_fn }
+      module mem_fun_ref                { export std_functional.__functional.mem_fun_ref }
+      module not_fn                     { export std_functional.__functional.not_fn }
+      module operations                 { export std___functional_operations }
+      module perfect_forward            { export std_functional.__functional.perfect_forward }
+      module pointer_to_binary_function { export std_functional.__functional.pointer_to_binary_function }
+      module pointer_to_unary_function  { export std_functional.__functional.pointer_to_unary_function }
+      module ranges_operations          { export std___functional_ranges_operations }
+      module reference_wrapper          { export std___functional_reference_wrapper }
+      module unary_function             { export std___functional_unary_function }
+      module unary_negate               { export std_functional.__functional.unary_negate }
+      module unwrap_ref                 { export std___functional_unwrap_ref }
+      module weak_result_type           { export std___functional_weak_result_type }
     }
   }
   module future {
@@ -965,8 +813,7 @@
     export *
   }
   module initializer_list {
-    header "initializer_list"
-    export *
+    export std_initializer_list
   }
   module iomanip {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
@@ -975,17 +822,14 @@
   }
   module ios {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
-    header "ios"
-    export iosfwd
-    export *
+    export std_ios
 
     module __ios {
-      module fpos { private header "__ios/fpos.h" }
+      module fpos { export std___ios_fpos }
     }
   }
   module iosfwd {
-    header "iosfwd"
-    export *
+    export std_iosfwd
   }
   module iostream {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
@@ -998,71 +842,62 @@
   }
   module istream {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
-    header "istream"
-    // FIXME: should re-export ios, streambuf?
-    export *
+    export std_istream
   }
   module iterator {
-    header "iterator"
-    export *
+    export std_iterator
 
     module __iterator {
-      module access                { private header "__iterator/access.h" }
-      module advance               { private header "__iterator/advance.h" }
-      module back_insert_iterator  { private header "__iterator/back_insert_iterator.h" }
-      module bounded_iter          { private header "__iterator/bounded_iter.h" }
-      module common_iterator       { private header "__iterator/common_iterator.h" }
-      module concepts {
-        private header "__iterator/concepts.h"
-        export concepts.equality_comparable
-        export type_traits.common_reference
-      }
-      module counted_iterator      { private header "__iterator/counted_iterator.h" }
-      module data                  { private header "__iterator/data.h" }
-      module default_sentinel      { private header "__iterator/default_sentinel.h" }
-      module distance              { private header "__iterator/distance.h" }
-      module empty                 { private header "__iterator/empty.h" }
-      module erase_if_container    { private header "__iterator/erase_if_container.h" }
-      module front_insert_iterator { private header "__iterator/front_insert_iterator.h" }
-      module incrementable_traits  { private header "__iterator/incrementable_traits.h" }
-      module indirectly_comparable { private header "__iterator/indirectly_comparable.h" }
-      module insert_iterator       { private header "__iterator/insert_iterator.h" }
-      module istream_iterator      { private header "__iterator/istream_iterator.h" }
-      module istreambuf_iterator   { private header "__iterator/istreambuf_iterator.h" }
-      module iter_move             { private header "__iterator/iter_move.h" }
-      module iter_swap             { private header "__iterator/iter_swap.h" }
-      module iterator              { private header "__iterator/iterator.h" }
-      module iterator_traits       { private header "__iterator/iterator_traits.h" }
-      module iterator_with_data    { private header "__iterator/iterator_with_data.h" }
-      module mergeable {
-        private header "__iterator/mergeable.h"
-        export functional.__functional.ranges_operations
-      }
-      module move_iterator         { private header "__iterator/move_iterator.h" }
-      module move_sentinel         { private header "__iterator/move_sentinel.h" }
-      module next                  { private header "__iterator/next.h" }
-      module ostream_iterator      { private header "__iterator/ostream_iterator.h" }
+      module access                { export std___iterator_access }
+      module advance               { export std___iterator_advance }
+      module back_insert_iterator  { export std_iterator.__iterator.back_insert_iterator }
+      module bounded_iter          { export std_iterator.__iterator.bounded_iter }
+      module common_iterator       { export std_iterator.__iterator.common_iterator }
+      module concepts              {
+        export std___iterator_concepts
+      }
+      module counted_iterator      { export std_iterator.__iterator.counted_iterator }
+      module data                  { export std_iterator.__iterator.data }
+      module default_sentinel      { export std_iterator.__iterator.default_sentinel }
+      module distance              { export std_iterator.__iterator.distance }
+      module empty                 { export std_iterator.__iterator.empty }
+      module erase_if_container    { export std_iterator.__iterator.erase_if_container }
+      module front_insert_iterator { export std_iterator.__iterator.front_insert_iterator }
+      module incrementable_traits  { export std___iterator_incrementable_traits }
+      module indirectly_comparable { export std_iterator.__iterator.indirectly_comparable }
+      module insert_iterator       { export std_iterator.__iterator.insert_iterator }
+      module istream_iterator      { export std_iterator.__iterator.istream_iterator }
+      module istreambuf_iterator   { export std_iterator.__iterator.istreambuf_iterator }
+      module iter_move             { export std___iterator_iter_move }
+      module iter_swap             { export std_iterator.__iterator.iter_swap }
+      module iterator              { export std_iterator.__iterator.iterator }
+      module iterator_traits       { export std___iterator.iterator_traits }
+      module iterator_with_data    { export std_iterator.__iterator.iterator_with_data }
+      module mergeable             {
+        export std_iterator.__iterator.mergeable
+      }
+      module move_iterator         { export std_iterator.__iterator.move_iterator }
+      module move_sentinel         { export std_iterator.__iterator.move_sentinel }
+      module next                  { export std_iterator.__iterator.next }
+      module ostream_iterator      { export std_iterator.__iterator.ostream_iterator }
       module ostreambuf_iterator   {
-        private header "__iterator/ostreambuf_iterator.h"
-        export iosfwd
+        export std_iterator.__iterator.ostreambuf_iterator
       }
-      module permutable            { private header "__iterator/permutable.h" }
-      module prev                  { private header "__iterator/prev.h" }
-      module projected             { private header "__iterator/projected.h" }
+      module permutable            { export std_iterator.__iterator.permutable }
+      module prev                  { export std___iterator_prev }
+      module projected             { export std_iterator.__iterator.projected }
       module readable_traits       {
-        private header "__iterator/readable_traits.h"
-        export __iterator.iterator_traits
+        export std___iterator.readable_traits
       }
-      module reverse_access        { private header "__iterator/reverse_access.h" }
-      module reverse_iterator      { private header "__iterator/reverse_iterator.h" }
-      module segmented_iterator    { private header "__iterator/segmented_iterator.h" }
-      module size                  { private header "__iterator/size.h" }
-      module sortable {
-        private header "__iterator/sortable.h"
-        export functional.__functional.ranges_operations
+      module reverse_access        { export std_iterator.__iterator.reverse_access }
+      module reverse_iterator      { export std_iterator.__iterator.reverse_iterator }
+      module segmented_iterator    { export std_iterator.__iterator.segmented_iterator }
+      module size                  { export std_iterator.__iterator.size }
+      module sortable              {
+        export std_iterator.__iterator.sortable
       }
-      module unreachable_sentinel  { private header "__iterator/unreachable_sentinel.h" }
-      module wrap_iter             { private header "__iterator/wrap_iter.h" }
+      module unreachable_sentinel  { export std_iterator.__iterator.unreachable_sentinel }
+      module wrap_iter             { export std_iterator.__iterator.wrap_iter }
     }
   }
   module latch {
@@ -1072,12 +907,11 @@
   }
 
   module __debug_utils {
-    module randomize_range { private header "__debug_utils/randomize_range.h" }
+    module randomize_range { export std___debug_utils.randomize_range }
   }
 
   module limits {
-    header "limits"
-    export *
+    export std_limits
   }
   module list {
     header "list"
@@ -1086,8 +920,7 @@
   }
   module locale {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
-    header "locale"
-    export *
+    export std_locale
   }
   module map {
     header "map"
@@ -1095,45 +928,42 @@
     export *
   }
   module memory {
-    header "memory"
-    export *
+    export std_memory
 
     module __memory {
-      module addressof                       { private header "__memory/addressof.h" }
-      module align                           { private header "__memory/align.h" }
-      module aligned_alloc                   { private header "__memory/aligned_alloc.h" }
-      module allocate_at_least               { private header "__memory/allocate_at_least.h" }
-      module allocation_guard                { private header "__memory/allocation_guard.h" }
-      module allocator                       { private header "__memory/allocator.h" }
-      module allocator_arg_t                 { private header "__memory/allocator_arg_t.h" }
-      module allocator_destructor            { private header "__memory/allocator_destructor.h" }
-      module allocator_traits                { private header "__memory/allocator_traits.h" }
-      module assume_aligned                  { private header "__memory/assume_aligned.h" }
-      module auto_ptr                        { private header "__memory/auto_ptr.h" }
-      module builtin_new_allocator           { private header "__memory/builtin_new_allocator.h" }
-      module compressed_pair                 { private header "__memory/compressed_pair.h" }
+      module addressof                       { export std___memory_addressof }
+      module align                           { export std_memory.__memory.align }
+      module aligned_alloc                   { export std_memory.__memory.aligned_alloc }
+      module allocate_at_least               { export std_memory.__memory.allocate_at_least }
+      module allocation_guard                { export std_memory.__memory.allocation_guard }
+      module allocator                       { export std_memory.__memory.allocator }
+      module allocator_arg_t                 { export std___memory_allocator_arg_t }
+      module allocator_destructor            { export std_memory.__memory.allocator_destructor }
+      module allocator_traits                { export std___memory_allocator_traits }
+      module assume_aligned                  { export std_memory.__memory.assume_aligned }
+      module auto_ptr                        { export std_memory.__memory.auto_ptr }
+      module builtin_new_allocator           { export std_memory.__memory.builtin_new_allocator }
+      module compressed_pair                 { export std_memory.__memory.compressed_pair }
       module concepts                        {
-        private header "__memory/concepts.h"
-        export type_traits.remove_reference
+        export std_memory.__memory.concepts
       }
-      module construct_at                    { private header "__memory/construct_at.h" }
-      module destruct_n                      { private header "__memory/destruct_n.h" }
-      module pointer_traits                  { private header "__memory/pointer_traits.h" }
-      module ranges_construct_at             { private header "__memory/ranges_construct_at.h" }
+      module construct_at                    { export std___memory_construct_at }
+      module destruct_n                      { export std_memory.__memory.destruct_n }
+      module pointer_traits                  { export std___memory_pointer_traits }
+      module ranges_construct_at             { export std_memory.__memory.ranges_construct_at }
       module ranges_uninitialized_algorithms {
-        private header "__memory/ranges_uninitialized_algorithms.h"
-        export algorithm.__algorithm.in_out_result
+        export std_memory.__memory.ranges_uninitialized_algorithms
       }
-      module raw_storage_iterator            { private header "__memory/raw_storage_iterator.h" }
-      module shared_ptr                      { private header "__memory/shared_ptr.h" }
-      module swap_allocator                  { private header "__memory/swap_allocator.h" }
-      module temp_value                      { private header "__memory/temp_value.h" }
-      module temporary_buffer                { private header "__memory/temporary_buffer.h" }
-      module uninitialized_algorithms        { private header "__memory/uninitialized_algorithms.h" }
-      module unique_ptr                      { private header "__memory/unique_ptr.h" }
-      module uses_allocator                  { private header "__memory/uses_allocator.h" }
-      module uses_allocator_construction     { private header "__memory/uses_allocator_construction.h" }
-      module voidify                         { private header "__memory/voidify.h" }
+      module raw_storage_iterator            { export std_memory.__memory.raw_storage_iterator }
+      module shared_ptr                      { export std_memory.__memory.shared_ptr }
+      module swap_allocator                  { export std_memory.__memory.swap_allocator }
+      module temp_value                      { export std_memory.__memory.temp_value }
+      module temporary_buffer                { export std_memory.__memory.temporary_buffer }
+      module uninitialized_algorithms        { export std_memory.__memory.uninitialized_algorithms }
+      module unique_ptr                      { export std_memory.__memory.unique_ptr }
+      module uses_allocator                  { export std___memory_uses_allocator }
+      module uses_allocator_construction     { export std_memory.__memory.uses_allocator_construction }
+      module voidify                         { export std___memory_voidify }
     }
   }
   module memory_resource {
@@ -1141,10 +971,10 @@
     export *
 
     module __memory_resource {
-      module memory_resource              { private header "__memory_resource/memory_resource.h" }
-      module memory_resource_fwd          { private header "__fwd/memory_resource.h" }
+      module memory_resource              { export std___memory_resource_memory_resource }
+      module memory_resource_fwd          { export std___memory_resource_memory_resource_fwd }
       module monotonic_buffer_resource    { private header "__memory_resource/monotonic_buffer_resource.h" }
-      module polymorphic_allocator        { private header "__memory_resource/polymorphic_allocator.h" }
+      module polymorphic_allocator        { export std___memory_resource_polymorphic_allocator }
       module pool_options                 { private header "__memory_resource/pool_options.h" }
       module synchronized_pool_resource   { private header "__memory_resource/synchronized_pool_resource.h" }
       module unsynchronized_pool_resource { private header "__memory_resource/unsynchronized_pool_resource.h" }
@@ -1152,12 +982,10 @@
   }
   module mutex {
     @requires_LIBCXX_ENABLE_THREADS@
-    header "mutex"
-    export *
+    export std_mutex
   }
   module new {
-    header "new"
-    export *
+    export std_new
   }
   module numbers {
     header "numbers"
@@ -1184,19 +1012,14 @@
     }
   }
   module optional {
-    header "optional"
-    export *
+    export std_optional
   }
   module ostream {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
-    header "ostream"
-    // FIXME: should re-export ios, streambuf?
-    export *
+    export std_ostream
   }
   module queue {
-    header "queue"
-    export initializer_list
-    export *
+    export std_queue
   }
   module random {
     header "random"
@@ -1223,10 +1046,10 @@
       module geometric_distribution          { private header "__random/geometric_distribution.h" }
       module independent_bits_engine         { private header "__random/independent_bits_engine.h" }
       module is_seed_sequence                { private header "__random/is_seed_sequence.h" }
-      module is_valid                        { private header "__random/is_valid.h" }
+      module is_valid                        { export std___random_is_valid }
       module knuth_b                         { private header "__random/knuth_b.h" }
       module linear_congruential_engine      { private header "__random/linear_congruential_engine.h" }
-      module log2                            { private header "__random/log2.h" }
+      module log2                            { export std___random_log2 }
       module lognormal_distribution          { private header "__random/lognormal_distribution.h" }
       module mersenne_twister_engine         { private header "__random/mersenne_twister_engine.h" }
       module negative_binomial_distribution  { private header "__random/negative_binomial_distribution.h" }
@@ -1246,8 +1069,8 @@
       module shuffle_order_engine            { private header "__random/shuffle_order_engine.h" }
       module student_t_distribution          { private header "__random/student_t_distribution.h" }
       module subtract_with_carry_engine      { private header "__random/subtract_with_carry_engine.h" }
-      module uniform_int_distribution        { private header "__random/uniform_int_distribution.h" }
-      module uniform_random_bit_generator    { private header "__random/uniform_random_bit_generator.h" }
+      module uniform_int_distribution        { export std___random_uniform_int_distribution }
+      module uniform_random_bit_generator    { export std___random_uniform_random_bit_generator }
       module uniform_real_distribution       { private header "__random/uniform_real_distribution.h" }
       module weibull_distribution            { private header "__random/weibull_distribution.h" }
     }
@@ -1260,7 +1083,7 @@
     export *
 
     module __ranges {
-      module access                 { private header "__ranges/access.h" }
+      module access                 { export std___ranges_access }
       module all                    {
         private header "__ranges/all.h"
         export functional.__functional.compose
@@ -1268,21 +1091,21 @@
       }
       module as_rvalue_view         { private header "__ranges/as_rvalue_view.h" }
       module common_view            { private header "__ranges/common_view.h" }
-      module concepts               { private header "__ranges/concepts.h" }
+      module concepts               { export std___ranges_concepts }
       module copyable_box           { private header "__ranges/copyable_box.h" }
       module counted                {
         private header "__ranges/counted.h"
         export span
       }
-      module dangling               { private header "__ranges/dangling.h" }
-      module data                   { private header "__ranges/data.h" }
+      module dangling               { export std___ranges_dangling }
+      module data                   { export std___ranges_data }
       module drop_view              { private header "__ranges/drop_view.h" }
       module drop_while_view        { private header "__ranges/drop_while_view.h" }
       module elements_view          { private header "__ranges/elements_view.h" }
-      module empty                  { private header "__ranges/empty.h" }
+      module empty                  { export std___ranges_empty }
       module empty_view             { private header "__ranges/empty_view.h" }
-      module enable_borrowed_range  { private header "__ranges/enable_borrowed_range.h" }
-      module enable_view            { private header "__ranges/enable_view.h" }
+      module enable_borrowed_range  { export std___ranges_enable_borrowed_range }
+      module enable_view            { export std___ranges_enable_view }
       module filter_view            { private header "__ranges/filter_view.h" }
       module iota_view              { private header "__ranges/iota_view.h" }
       module istream_view           {
@@ -1299,12 +1122,12 @@
       module rend                   { private header "__ranges/rend.h" }
       module reverse_view           { private header "__ranges/reverse_view.h" }
       module single_view            { private header "__ranges/single_view.h" }
-      module size                   { private header "__ranges/size.h" }
+      module size                   { export std___ranges_size }
       module split_view             { private header "__ranges/split_view.h" }
       module subrange               {
-        private header "__ranges/subrange.h"
+        export std___ranges_subrange
 
-        module subrange_fwd { private header "__fwd/subrange.h" }
+        module subrange_fwd { export std___ranges_subrange_subrange_fwd}
       }
       module take_view              { private header "__ranges/take_view.h" }
       module take_while_view        { private header "__ranges/take_while_view.h" }
@@ -1313,14 +1136,13 @@
         export functional.__functional.bind_back
         export functional.__functional.perfect_forward
       }
-      module view_interface         { private header "__ranges/view_interface.h" }
+      module view_interface         { export std___ranges_view_interface }
       module views                  { private header "__ranges/views.h" }
       module zip_view               { private header "__ranges/zip_view.h" }
     }
   }
   module ratio {
-    header "ratio"
-    export *
+    export std_ratio
   }
   module regex {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
@@ -1359,41 +1181,30 @@
   }
   module sstream {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
-    header "sstream"
-    // FIXME: should re-export istream, ostream, ios, streambuf, string?
-    export *
+    export std_sstream
   }
   module stack {
-    header "stack"
-    export initializer_list
-    export *
+    export std_stack
   }
   module stdexcept {
-    header "stdexcept"
-    export *
+    export std_stdexcept
   }
   module streambuf {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
-    header "streambuf"
-    export *
+    export std_streambuf
   }
   module string {
-    header "string"
-    export initializer_list
-    export string_view
     module __string {
-      module char_traits           { private header "__string/char_traits.h" }
-      module constexpr_c_functions { private header "__string/constexpr_c_functions.h" }
-      module extern_template_lists { private header "__string/extern_template_lists.h" }
-      module string_fwd            { private header "__fwd/string.h" }
+      module char_traits           { export std___string_char_traits }
+      module constexpr_c_functions { export std___string_constexpr_c_functions }
+      module extern_template_lists { export std_string.__string.extern_template_lists }
+      module string_fwd            { export std___string_string_fwd }
     }
-    export *
+    export std_string
   }
   module string_view {
-    header "string_view"
-    export initializer_list
-    export *
-    module string_view_fwd { private header "__fwd/string_view.h" }
+    export std_string_view
+    module string_view_fwd { export std___string_view_string_view_fwd }
   }
   module strstream {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
@@ -1401,8 +1212,7 @@
     export *
   }
   module system_error {
-    header "system_error"
-    export *
+    export std_system_error
   }
   module thread {
     @requires_LIBCXX_ENABLE_THREADS@
@@ -1410,199 +1220,185 @@
     export *
 
     module __thread {
-      module poll_with_backoff    { private header "__thread/poll_with_backoff.h" }
-      module timed_backoff_policy { private header "__thread/timed_backoff_policy.h" }
+      module poll_with_backoff    { export std___thread_poll_with_backoff }
+      module timed_backoff_policy { export std___thread_timed_backoff_policy }
     }
   }
   module tuple {
-    header "tuple"
-    export *
+    export std_tuple
 
-    module apply_cv         { private header "__tuple_dir/apply_cv.h" }
-    module get_fwd          { private header "__fwd/get.h" }
-    module make_tuple_types { private header "__tuple_dir/make_tuple_types.h" }
-    module pair_like        { private header "__tuple_dir/pair_like.h" }
-    module sfinae_helpers   { private header "__tuple_dir/sfinae_helpers.h" }
-    module tuple_element    { private header "__tuple_dir/tuple_element.h" }
-    module tuple_fwd        { private header "__fwd/tuple.h" }
-    module tuple_indices    { private header "__tuple_dir/tuple_indices.h" }
-    module tuple_like       { private header "__tuple_dir/tuple_like.h" }
-    module tuple_like_ext   { private header "__tuple_dir/tuple_like_ext.h" }
-    module tuple_size       { private header "__tuple_dir/tuple_size.h" }
-    module tuple_types      { private header "__tuple_dir/tuple_types.h" }
+    module apply_cv         { export std___tuple_apply_cv }
+    module get_fwd          { export std___tuple_get_fwd }
+    module make_tuple_types { export std___tuple_make_tuple_types }
+    module pair_like        { export std_tuple.pair_like }
+    module sfinae_helpers   { export std___tuple_sfinae_helpers }
+    module tuple_element    { export std___tuple_tuple_element }
+    module tuple_fwd        { export std___tuple_tuple_fwd }
+    module tuple_indices    { export std___tuple_tuple_indices }
+    module tuple_like       { export std___tuple_tuple_like }
+    module tuple_like_ext   { export std___tuple_tuple_like_ext }
+    module tuple_size       { export std___tuple_tuple_size }
+    module tuple_types      { export std___tuple_tuple_types }
   }
   module type_traits {
-    header "type_traits"
-    export functional.__functional.unwrap_ref
-    export *
+    export std_type_traits
 
-    module add_const                           { private header "__type_traits/add_const.h" }
-    module add_cv                              { private header "__type_traits/add_cv.h" }
-    module add_lvalue_reference                { private header "__type_traits/add_lvalue_reference.h" }
-    module add_pointer                         { private header "__type_traits/add_pointer.h" }
-    module add_rvalue_reference                { private header "__type_traits/add_rvalue_reference.h" }
-    module add_volatile                        { private header "__type_traits/add_volatile.h" }
-    module aligned_storage                     { private header "__type_traits/aligned_storage.h" }
-    module aligned_union                       { private header "__type_traits/aligned_union.h" }
-    module alignment_of                        { private header "__type_traits/alignment_of.h" }
-    module apply_cv                            { private header "__type_traits/apply_cv.h" }
-    module can_extract_key                     { private header "__type_traits/can_extract_key.h" }
-    module common_reference                    { private header "__type_traits/common_reference.h" }
-    module common_type                         { private header "__type_traits/common_type.h" }
-    module conditional                         { private header "__type_traits/conditional.h" }
-    module conjunction                         { private header "__type_traits/conjunction.h" }
-    module copy_cv                             { private header "__type_traits/copy_cv.h" }
-    module copy_cvref                          { private header "__type_traits/copy_cvref.h" }
-    module decay                               { private header "__type_traits/decay.h" }
-    module dependent_type                      { private header "__type_traits/dependent_type.h" }
-    module disjunction                         { private header "__type_traits/disjunction.h" }
-    module enable_if                           { private header "__type_traits/enable_if.h" }
-    module extent                              { private header "__type_traits/extent.h" }
-    module has_unique_object_representation    { private header "__type_traits/has_unique_object_representation.h" }
-    module has_virtual_destructor              { private header "__type_traits/has_virtual_destructor.h" }
-    module integral_constant                   { private header "__type_traits/integral_constant.h" }
-    module is_abstract                         { private header "__type_traits/is_abstract.h" }
-    module is_aggregate                        { private header "__type_traits/is_aggregate.h" }
-    module is_allocator                        { private header "__type_traits/is_allocator.h" }
-    module is_always_bitcastable               { private header "__type_traits/is_always_bitcastable.h" }
-    module is_arithmetic {
-      private header "__type_traits/is_arithmetic.h"
-      export integral_constant
+    module add_const                           { export std___type_traits_add_const }
+    module add_cv                              { export std_type_traits.add_cv }
+    module add_lvalue_reference                { export std___type_traits_add_lvalue_reference }
+    module add_pointer                         { export std___type_traits_add_pointer }
+    module add_rvalue_reference                { export std___type_traits_add_rvalue_reference }
+    module add_volatile                        { export std_type_traits.add_volatile }
+    module aligned_storage                     { export std_type_traits.aligned_storage }
+    module aligned_union                       { export std_type_traits.aligned_union }
+    module alignment_of                        { export std___type_traits_alignment_of }
+    module apply_cv                            { export std___type_traits_apply_cv }
+    module can_extract_key                     { export std_type_traits.can_extract_key }
+    module common_reference                    { export std_type_traits.common_reference }
+    module common_type                         { export std_type_traits.common_type }
+    module conditional                         { export std___type_traits_conditional }
+    module conjunction                         { export std___type_traits_conjunction }
+    module copy_cv                             { export std_type_traits.copy_cv }
+    module copy_cvref                          { export std_type_traits.copy_cvref }
+    module decay                               { export std___type_traits_decay }
+    module dependent_type                      { export std_type_traits.dependent_type }
+    module disjunction                         { export std_type_traits.disjunction }
+    module enable_if                           { export std___type_traits_enable_if }
+    module extent                              { export std_type_traits.extent }
+    module has_unique_object_representation    { export std_type_traits.has_unique_object_representation }
+    module has_virtual_destructor              { export std_type_traits.has_virtual_destructor }
+    module integral_constant                   { export std___type_traits_integral_constant }
+    module is_abstract                         { export std_type_traits.is_abstract }
+    module is_aggregate                        { export std_type_traits.is_aggregate }
+    module is_allocator                        { export std_type_traits.is_allocator }
+    module is_always_bitcastable               { export std_type_traits.is_always_bitcastable }
+    module is_arithmetic                       {
+      export std___type_traits_is_arithmetic
     }
     module is_array                            {
-      private header "__type_traits/is_array.h"
-      export integral_constant
-    }
-    module is_assignable                       { private header "__type_traits/is_assignable.h" }
-    module is_base_of                          { private header "__type_traits/is_base_of.h" }
-    module is_bounded_array                    { private header "__type_traits/is_bounded_array.h" }
-    module is_callable                         { private header "__type_traits/is_callable.h" }
-    module is_char_like_type                   { private header "__type_traits/is_char_like_type.h" }
-    module is_class                            { private header "__type_traits/is_class.h" }
-    module is_compound                         { private header "__type_traits/is_compound.h" }
-    module is_const                            { private header "__type_traits/is_const.h" }
-    module is_constant_evaluated               { private header "__type_traits/is_constant_evaluated.h" }
-    module is_constructible                    { private header "__type_traits/is_constructible.h" }
-    module is_convertible                      { private header "__type_traits/is_convertible.h" }
-    module is_copy_assignable                  { private header "__type_traits/is_copy_assignable.h" }
-    module is_copy_constructible               { private header "__type_traits/is_copy_constructible.h" }
+      export std___type_traits_is_array
+    }
+    module is_assignable                       { export std_type_traits.is_assignable }
+    module is_base_of                          { export std___type_traits_is_base_of }
+    module is_bounded_array                    { export std_type_traits.is_bounded_array }
+    module is_callable                         { export std_type_traits.is_callable }
+    module is_char_like_type                   { export std_type_traits.is_char_like_type }
+    module is_class                            { export std___type_traits_is_class }
+    module is_compound                         { export std_type_traits.is_compound }
+    module is_const                            { export std___type_traits_is_const }
+    module is_constant_evaluated               { export std_type_traits.is_constant_evaluated }
+    module is_constructible                    { export std___type_traits_is_constructible }
+    module is_convertible                      { export std___type_traits_is_convertible }
+    module is_copy_assignable                  { export std_type_traits.is_copy_assignable }
+    module is_copy_constructible               { export std___type_traits_is_copy_constructible }
     module is_core_convertible                 {
-      private header "__type_traits/is_core_convertible.h"
-      export integral_constant
+      export std___type_traits_is_core_convertible
     }
-    module is_default_constructible            { private header "__type_traits/is_default_constructible.h" }
-    module is_destructible                     { private header "__type_traits/is_destructible.h" }
-    module is_empty                            { private header "__type_traits/is_empty.h" }
-    module is_enum                             { private header "__type_traits/is_enum.h" }
+    module is_default_constructible            { export std_type_traits.is_default_constructible }
+    module is_destructible                     { export std_type_traits.is_destructible }
+    module is_empty                            { export std___type_traits_is_empty }
+    module is_enum                             { export std___type_traits_is_enum }
     module is_equality_comparable                       {
-      private header "__type_traits/is_equality_comparable.h"
-      export integral_constant
-    }
-    module is_final                            { private header "__type_traits/is_final.h" }
-    module is_floating_point                   { private header "__type_traits/is_floating_point.h" }
-    module is_function                         { private header "__type_traits/is_function.h" }
-    module is_fundamental                      { private header "__type_traits/is_fundamental.h" }
-    module is_implicitly_default_constructible { private header "__type_traits/is_implicitly_default_constructible.h" }
-    module is_integral                         { private header "__type_traits/is_integral.h" }
-    module is_literal_type                     { private header "__type_traits/is_literal_type.h" }
-    module is_member_function_pointer          { private header "__type_traits/is_member_function_pointer.h" }
-    module is_member_object_pointer            { private header "__type_traits/is_member_object_pointer.h" }
-    module is_member_pointer                   { private header "__type_traits/is_member_pointer.h" }
-    module is_move_assignable                  { private header "__type_traits/is_move_assignable.h" }
-    module is_move_constructible               { private header "__type_traits/is_move_constructible.h" }
-    module is_nothrow_assignable               { private header "__type_traits/is_nothrow_assignable.h" }
-    module is_nothrow_constructible            { private header "__type_traits/is_nothrow_constructible.h" }
-    module is_nothrow_convertible              { private header "__type_traits/is_nothrow_convertible.h" }
-    module is_nothrow_copy_assignable          { private header "__type_traits/is_nothrow_copy_assignable.h" }
-    module is_nothrow_copy_constructible       { private header "__type_traits/is_nothrow_copy_constructible.h" }
-    module is_nothrow_default_constructible    { private header "__type_traits/is_nothrow_default_constructible.h" }
-    module is_nothrow_destructible             { private header "__type_traits/is_nothrow_destructible.h" }
-    module is_nothrow_move_assignable          { private header "__type_traits/is_nothrow_move_assignable.h" }
-    module is_nothrow_move_constructible       { private header "__type_traits/is_nothrow_move_constructible.h" }
-    module is_null_pointer                     { private header "__type_traits/is_null_pointer.h" }
-    module is_object                           { private header "__type_traits/is_object.h" }
-    module is_pod                              { private header "__type_traits/is_pod.h" }
-    module is_pointer                          { private header "__type_traits/is_pointer.h" }
-    module is_polymorphic                      { private header "__type_traits/is_polymorphic.h" }
-    module is_primary_template                 { private header "__type_traits/is_primary_template.h" }
-    module is_reference                        { private header "__type_traits/is_reference.h" }
-    module is_reference_wrapper                { private header "__type_traits/is_reference_wrapper.h" }
-    module is_referenceable                    { private header "__type_traits/is_referenceable.h" }
+      export std_type_traits.is_equality_comparable
+    }
+    module is_final                            { export std___type_traits_is_final }
+    module is_floating_point                   { export std___type_traits_is_floating_point }
+    module is_function                         { export std___type_traits_is_function }
+    module is_fundamental                      { export std_type_traits.is_fundamental }
+    module is_implicitly_default_constructible { export std_type_traits.is_implicitly_default_constructible }
+    module is_integral                         { export std___type_traits_is_integral }
+    module is_literal_type                     { export std_type_traits.is_literal_type }
+    module is_member_function_pointer          { export std___type_traits_is_member_function_pointer }
+    module is_member_object_pointer            { export std___type_traits_is_member_object_pointer }
+    module is_member_pointer                   { export std_type_traits.is_member_pointer }
+    module is_move_assignable                  { export std_type_traits.is_move_assignable }
+    module is_move_constructible               { export std___type_traits_is_move_constructible }
+    module is_nothrow_assignable               { export std_type_traits.is_nothrow_assignable }
+    module is_nothrow_constructible            { export std___type_traits_is_nothrow_constructible }
+    module is_nothrow_convertible              { export std_type_traits.is_nothrow_convertible }
+    module is_nothrow_copy_assignable          { export std_type_traits.is_nothrow_copy_assignable }
+    module is_nothrow_copy_constructible       { export std_type_traits.is_nothrow_copy_constructible }
+    module is_nothrow_default_constructible    { export std_type_traits.is_nothrow_default_constructible }
+    module is_nothrow_destructible             { export std_type_traits.is_nothrow_destructible }
+    module is_nothrow_move_assignable          { export std_type_traits.is_nothrow_move_assignable }
+    module is_nothrow_move_constructible       { export std___type_traits_is_nothrow_move_constructible }
+    module is_null_pointer                     { export std_type_traits.is_null_pointer }
+    module is_object                           { export std_type_traits.is_object }
+    module is_pod                              { export std_type_traits.is_pod }
+    module is_pointer                          { export std_type_traits.is_pointer }
+    module is_polymorphic                      { export std___type_traits_is_polymorphic }
+    module is_primary_template                 { export std_type_traits.is_primary_template }
+    module is_reference                        { export std___type_traits_is_reference }
+    module is_reference_wrapper                { export std___type_traits_is_reference_wrapper }
+    module is_referenceable                    { export std___type_traits_is_referenceable }
     module is_same                             {
-      private header "__type_traits/is_same.h"
-      export type_traits.integral_constant
-    }
-    module is_scalar                           { private header "__type_traits/is_scalar.h" }
-    module is_scoped_enum                      { private header "__type_traits/is_scoped_enum.h" }
-    module is_signed                           { private header "__type_traits/is_signed.h" }
-    module is_signed_integer                   { private header "__type_traits/is_signed_integer.h" }
-    module is_specialization                   { private header "__type_traits/is_specialization.h" }
-    module is_standard_layout                  { private header "__type_traits/is_standard_layout.h" }
-    module is_swappable                        { private header "__type_traits/is_swappable.h" }
-    module is_trivial                          { private header "__type_traits/is_trivial.h" }
-    module is_trivially_assignable             { private header "__type_traits/is_trivially_assignable.h" }
-    module is_trivially_constructible          { private header "__type_traits/is_trivially_constructible.h" }
-    module is_trivially_copy_assignable        { private header "__type_traits/is_trivially_copy_assignable.h" }
-    module is_trivially_copy_constructible     { private header "__type_traits/is_trivially_copy_constructible.h" }
-    module is_trivially_copyable               { private header "__type_traits/is_trivially_copyable.h" }
-    module is_trivially_default_constructible  { private header "__type_traits/is_trivially_default_constructible.h" }
-    module is_trivially_destructible           { private header "__type_traits/is_trivially_destructible.h" }
-    module is_trivially_move_assignable        { private header "__type_traits/is_trivially_move_assignable.h" }
-    module is_trivially_move_constructible     { private header "__type_traits/is_trivially_move_constructible.h" }
-    module is_unbounded_array                  { private header "__type_traits/is_unbounded_array.h" }
-    module is_union                            { private header "__type_traits/is_union.h" }
-    module is_unsigned                         { private header "__type_traits/is_unsigned.h" }
-    module is_unsigned_integer                 { private header "__type_traits/is_unsigned_integer.h" }
-    module is_valid_expansion                  { private header "__type_traits/is_valid_expansion.h" }
+      export std___type_traits_is_same
+    }
+    module is_scalar                           { export std_type_traits.is_scalar }
+    module is_scoped_enum                      { export std_type_traits.is_scoped_enum }
+    module is_signed                           { export std___type_traits_is_signed }
+    module is_signed_integer                   { export std_type_traits.is_signed_integer }
+    module is_specialization                   { export std_type_traits.is_specialization }
+    module is_standard_layout                  { export std_type_traits.is_standard_layout }
+    module is_swappable                        { export std_type_traits.is_swappable }
+    module is_trivial                          { export std_type_traits.is_trivial }
+    module is_trivially_assignable             { export std_type_traits.is_trivially_assignable }
+    module is_trivially_constructible          { export std_type_traits.is_trivially_constructible }
+    module is_trivially_copy_assignable        { export std_type_traits.is_trivially_copy_assignable }
+    module is_trivially_copy_constructible     { export std_type_traits.is_trivially_copy_constructible }
+    module is_trivially_copyable               { export std_type_traits.is_trivially_copyable }
+    module is_trivially_default_constructible  { export std_type_traits.is_trivially_default_constructible }
+    module is_trivially_destructible           { export std_type_traits.is_trivially_destructible }
+    module is_trivially_move_assignable        { export std_type_traits.is_trivially_move_assignable }
+    module is_trivially_move_constructible     { export std_type_traits.is_trivially_move_constructible }
+    module is_unbounded_array                  { export std_type_traits.is_unbounded_array }
+    module is_union                            { export std_type_traits.is_union }
+    module is_unsigned                         { export std___type_traits_is_unsigned }
+    module is_unsigned_integer                 { export std_type_traits.is_unsigned_integer }
+    module is_valid_expansion                  { export std_type_traits.is_valid_expansion }
     module is_void                             {
-      private header "__type_traits/is_void.h"
-      export integral_constant
-    }
-    module is_volatile                         { private header "__type_traits/is_volatile.h" }
-    module lazy                                { private header "__type_traits/lazy.h" }
-    module make_32_64_or_128_bit               { private header "__type_traits/make_32_64_or_128_bit.h" }
-    module make_const_lvalue_ref               { private header "__type_traits/make_const_lvalue_ref.h" }
-    module make_signed                         { private header "__type_traits/make_signed.h" }
-    module make_unsigned                       { private header "__type_traits/make_unsigned.h" }
-    module maybe_const                         { private header "__type_traits/maybe_const.h" }
-    module nat                                 { private header "__type_traits/nat.h" }
-    module negation                            { private header "__type_traits/negation.h" }
-    module noexcept_move_assign_container      { private header "__type_traits/noexcept_move_assign_container.h" }
-    module predicate_traits                    { private header "__type_traits/predicate_traits.h" }
-    module promote                             { private header "__type_traits/promote.h" }
-    module rank                                { private header "__type_traits/rank.h" }
-    module remove_all_extents                  { private header "__type_traits/remove_all_extents.h" }
-    module remove_const                        { private header "__type_traits/remove_const.h" }
-    module remove_const_ref                    { private header "__type_traits/remove_const_ref.h" }
-    module remove_cv                           { private header "__type_traits/remove_cv.h" }
-    module remove_cvref                        { private header "__type_traits/remove_cvref.h" }
-    module remove_extent                       { private header "__type_traits/remove_extent.h" }
-    module remove_pointer                      { private header "__type_traits/remove_pointer.h" }
-    module remove_reference                    { private header "__type_traits/remove_reference.h" }
-    module remove_volatile                     { private header "__type_traits/remove_volatile.h" }
-    module result_of                           { private header "__type_traits/result_of.h" }
-    module strip_signature                     { private header "__type_traits/strip_signature.h" }
-    module type_identity                       { private header "__type_traits/type_identity.h" }
-    module type_list                           { private header "__type_traits/type_list.h" }
+      export std___type_traits_is_void
+    }
+    module is_volatile                         { export std___type_traits_is_volatile }
+    module lazy                                { export std_type_traits.lazy }
+    module make_32_64_or_128_bit               { export std_type_traits.make_32_64_or_128_bit }
+    module make_const_lvalue_ref               { export std_type_traits.make_const_lvalue_ref }
+    module make_signed                         { export std_type_traits.make_signed }
+    module make_unsigned                       { export std___type_traits_make_unsigned }
+    module maybe_const                         { export std_type_traits.maybe_const }
+    module nat                                 { export std___type_traits_nat }
+    module negation                            { export std_type_traits.negation }
+    module noexcept_move_assign_container      { export std_type_traits.noexcept_move_assign_container }
+    module predicate_traits                    { export std_type_traits.predicate_traits }
+    module promote                             { export std_type_traits.promote }
+    module rank                                { export std_type_traits.rank }
+    module remove_all_extents                  { export std_type_traits.remove_all_extents }
+    module remove_const                        { export std___type_traits_remove_const }
+    module remove_const_ref                    { export std_type_traits.remove_const_ref }
+    module remove_cv                           { export std___type_traits_remove_cv }
+    module remove_cvref                        { export std_type_traits.remove_cvref }
+    module remove_extent                       { export std___type_traits_remove_extent }
+    module remove_pointer                      { export std_type_traits.remove_pointer }
+    module remove_reference                    { export std___type_traits_remove_reference }
+    module remove_volatile                     { export std___type_traits_remove_volatile }
+    module result_of                           { export std_type_traits.result_of }
+    module strip_signature                     { export std_type_traits.strip_signature }
+    module type_identity                       { export std_type_traits.type_identity }
+    module type_list                           { export std___type_traits_type_list }
     module underlying_type                     {
-      private header "__type_traits/underlying_type.h"
-
-      export type_traits
+      export std_type_traits.underlying_type
     }
-    module void_t                              { private header "__type_traits/void_t.h" }
+    module void_t                              { export std___type_traits_void_t }
   }
   module typeindex {
     header "typeindex"
     export *
   }
   module typeinfo {
-    header "typeinfo"
-    export *
+    export std_typeinfo
   }
   module unordered_map {
-    header "unordered_map"
-    export initializer_list
-    export *
+    export std_unordered_map
   }
   module unordered_set {
     header "unordered_set"
@@ -1610,31 +1406,29 @@
     export *
   }
   module utility {
-    header "utility"
-    export initializer_list
-    export *
+    export std_utility
 
     module __utility {
-      module as_const            { private header "__utility/as_const.h" }
-      module auto_cast           { private header "__utility/auto_cast.h" }
-      module cmp                 { private header "__utility/cmp.h" }
-      module convert_to_integral { private header "__utility/convert_to_integral.h" }
-      module declval             { private header "__utility/declval.h" }
-      module exception_guard     { private header "__utility/exception_guard.h" }
-      module exchange            { private header "__utility/exchange.h" }
-      module forward             { private header "__utility/forward.h" }
-      module forward_like        { private header "__utility/forward_like.h" }
-      module in_place            { private header "__utility/in_place.h" }
-      module integer_sequence    { private header "__utility/integer_sequence.h" }
-      module move                { private header "__utility/move.h" }
-      module pair                { private header "__utility/pair.h" }
-      module pair_fwd            { private header "__fwd/pair.h" }
-      module piecewise_construct { private header "__utility/piecewise_construct.h" }
-      module priority_tag        { private header "__utility/priority_tag.h" }
-      module rel_ops             { private header "__utility/rel_ops.h" }
-      module swap                { private header "__utility/swap.h" }
-      module to_underlying       { private header "__utility/to_underlying.h" }
-      module unreachable         { private header "__utility/unreachable.h" }
+      module as_const            { export std_utility.__utility.as_const }
+      module auto_cast           { export std_utility.__utility.auto_cast }
+      module cmp                 { export std_utility.__utility.cmp }
+      module convert_to_integral { export std_utility.__utility.convert_to_integral }
+      module declval             { export std___utility_declval }
+      module exception_guard     { export std_utility.__utility.exception_guard }
+      module exchange            { export std___utility_exchange }
+      module forward             { export std___utility_forward }
+      module forward_like        { export std_utility.__utility.forward_like }
+      module in_place            { export std_utility.__utility.in_place }
+      module integer_sequence    { export std___utility_integer_sequence }
+      module move                { export std___utility_move }
+      module pair                { export std_utility.__utility.pair }
+      module pair_fwd            { export std___utility_pair_fwd }
+      module piecewise_construct { export std_utility.__utility.piecewise_construct }
+      module priority_tag        { export std___utility_priority_tag }
+      module rel_ops             { export std_utility.__utility.rel_ops }
+      module swap                { export std___utility_swap }
+      module to_underlying       { export std_utility.__utility.to_underlying }
+      module unreachable         { export std_utility.__utility.unreachable }
     }
   }
   module valarray {
@@ -1643,46 +1437,42 @@
     export *
   }
   module variant {
-    header "variant"
-    export *
+    export std_variant
 
     module __variant {
-      module monostate { private header "__variant/monostate.h" }
+      module monostate { export std_variant.__variant.monostate }
     }
   }
   module vector {
-    header "vector"
-    export initializer_list
-    export *
+    export std_vector
   }
   module version {
-    header "version"
-    export *
+    export std_version
   }
 
   // FIXME: These should be private.
-  module __assert            {         header "__assert"            export * }
-  module __availability      { private header "__availability"      export * }
-  module __bit_reference     { private header "__bit_reference"     export * }
-  module __debug             {         header "__debug"             export * }
-  module __errc              { private header "__errc"              export * }
-  module __hash_table        {         header "__hash_table"        export * }
+  module __assert            {                           export std___assert }
+  module __availability      {                     export std___availability }
+  module __bit_reference     {                    export std___bit_reference }
+  module __debug             {                            export std___debug }
+  module __errc              {                             export std___errc }
+  module __hash_table        {                       export std___hash_table }
   module __locale            {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
-    private header "__locale" export *
+    export std___locale
   }
-  module __mbstate_t         { private header "__mbstate_t.h"       export * }
-  module __mutex_base        { private header "__mutex_base"        export * }
-  module __node_handle       { private header "__node_handle"       export * }
-  module __split_buffer      { private header "__split_buffer"      export * }
+  module __mbstate_t         {                        export std___mbstate_t }
+  module __mutex_base        {                       export std___mutex_base }
+  module __node_handle       {                      export std___node_handle }
+  module __split_buffer      {                     export std___split_buffer }
   module __std_stream        {
     @requires_LIBCXX_ENABLE_LOCALIZATION@
     private header "__std_stream" export *
   }
-  module __threading_support {         header "__threading_support" export * }
+  module __threading_support {                export std___threading_support }
   module __tree              {         header "__tree"              export * }
-  module __undef_macros      {         header "__undef_macros"      export * }
-  module __verbose_abort     {         header "__verbose_abort"     export * }
+  module __undef_macros      {                     export std___undef_macros }
+  module __verbose_abort     {                    export std___verbose_abort }
 
   module experimental {
     requires cplusplus11
@@ -1771,3 +1561,1338 @@
     }
   } // end experimental
 }
+
+// The following modules are defined outside of the top level 'std' module to
+// layer correctly with modules from the compiler and C library. e.g. stdlib.h
+// here will #include_next stdlib.h from the compiler and then the C library.
+// Either of those are likely to include stddef.h, which will come back up to
+// this module map. stdlib.h and stddef.h must be in different top level
+// modules, or it will constitute a module cycle. The rest of these top level
+// modules are everything under the C standard library headers, split up as
+// needed to remove cycles between them. None of these modules are meant to be
+// directly imported, and 'std' should generally be used.
+
+// FIXME: The specific exports in the top level modules interfere with the
+// 'export *' in local submodule visibility mode, and so had to be commented out.
+
+// C standard library headers augmented/replaced by libc++
+// <assert.h> provided by C library.
+module std_complex_h [system] {
+  header "complex.h"
+//  export std_ccomplex
+  export *
+}
+module std_ctype_h [system] {
+  header "ctype.h"
+  export *
+}
+module std_errno_h [system] {
+  header "errno.h"
+  export *
+}
+module std_fenv_h [system] {
+  header "fenv.h"
+  export *
+}
+module std_float_h [system] {
+  header "float.h"
+  export *
+}
+module std_inttypes_h [system] {
+  header "inttypes.h"
+//  export std_stdint_h
+  export *
+}
+// <iso646.h> provided by compiler.
+module std_limits_h [system] {
+  header "limits.h"
+  export *
+}
+module std_locale_h [system] {
+  @requires_LIBCXX_ENABLE_LOCALIZATION@
+  header "locale.h"
+  export *
+}
+module std_math_h [system] {
+  header "math.h"
+  export *
+}
+module std_setjmp_h [system] {
+  header "setjmp.h"
+  export *
+}
+module std_stdatomic_h [system] {
+  @requires_LIBCXX_ENABLE_THREADS@
+  requires cplusplus23
+  header "stdatomic.h"
+  export *
+}
+// FIXME: <stdalign.h> is missing.
+// <signal.h> provided by C library.
+// <stdarg.h> provided by compiler.
+module std_stdbool_h [system] {
+  // <stdbool.h>'s __bool_true_false_are_defined macro requires textual inclusion.
+  textual header "stdbool.h"
+}
+module std_stddef_h [system] {
+  // <stddef.h>'s __need_* macros require textual inclusion.
+  textual header "stddef.h"
+}
+module std_stdint_h [system] {
+  header "stdint.h"
+  export *
+}
+module std_stdio_h [system] {
+  // <stdio.h>'s __need_* macros require textual inclusion.
+  textual header "stdio.h"
+  export *
+}
+module std_stdlib_h [system] {
+  // <stdlib.h>'s __need_* macros require textual inclusion.
+  textual header "stdlib.h"
+  export *
+}
+module std_string_h [system] {
+  header "string.h"
+  export *
+}
+module std_tgmath_h [system] {
+  header "tgmath.h"
+//  export std_ccomplex
+//  export std_cmath
+  export *
+}
+module std_uchar_h [system] {
+  header "uchar.h"
+  export *
+}
+// <time.h> provided by C library.
+module std_wchar_h [system] {
+  @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@
+  // <wchar.h>'s __need_* macros require textual inclusion.
+  textual header "wchar.h"
+  export *
+}
+module std_wctype_h [system] {
+  @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@
+  header "wctype.h"
+  export *
+}
+
+// C compatibility headers used by the above standalone modules.
+module std_ccomplex [system] {
+  header "ccomplex"
+//  export std_complex
+  export *
+}
+module std_cctype [system] {
+  header "cctype"
+  export *
+}
+module std_cerrno [system] {
+  header "cerrno"
+  export *
+}
+module std_climits [system] {
+  header "climits"
+  export *
+}
+module std_cmath [system] {
+  header "cmath"
+  export *
+}
+module std_cstdarg [system] {
+  header "cstdarg"
+  export *
+}
+module std_cstddef [system] {
+  header "cstddef"
+  export *
+}
+module std_cstdint [system] {
+  header "cstdint"
+//  export std_stdint_h
+  export *
+}
+module std_cstdio [system] {
+  header "cstdio"
+  export *
+}
+module std_cstdlib [system] {
+  header "cstdlib"
+  export *
+}
+module std_cstring [system] {
+  header "cstring"
+  export *
+}
+module std_ctgmath [system] {
+  header "ctgmath"
+//  export std_ccomplex
+//  export std_cmath
+  export *
+}
+module std_ctime [system] {
+  header "ctime"
+  export *
+}
+module std_cwchar [system] {
+  @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@
+  header "cwchar"
+//  export std_stdio_h
+  export *
+}
+module std_cwctype [system] {
+  @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@
+  header "cwctype"
+  export *
+}
+
+// C++ standard library headers used by the above standalone
+// modules. The 'std___' modules should especially not be used
+// directly, they're there to break module cycles between the
+// 'std_' modules.
+module std_algorithm [system] {
+  header "algorithm"
+//  export std_initializer_list
+  export *
+
+  module __algorithm {
+    module adjacent_find                   { header "__algorithm/adjacent_find.h" }
+    module all_of                          { header "__algorithm/all_of.h" }
+    module any_of                          { header "__algorithm/any_of.h" }
+    module binary_search                   { header "__algorithm/binary_search.h" }
+    module clamp                           { header "__algorithm/clamp.h" }
+    module copy_backward                   { header "__algorithm/copy_backward.h" }
+    module copy_if                         { header "__algorithm/copy_if.h" }
+    module count                           { header "__algorithm/count.h" }
+    module count_if                        { header "__algorithm/count_if.h" }
+    module equal                           { header "__algorithm/equal.h" }
+    module equal_range                     { header "__algorithm/equal_range.h" }
+    module fill                            { header "__algorithm/fill.h" }
+    module find                            { header "__algorithm/find.h" }
+    module find_if                         { header "__algorithm/find_if.h" }
+    module find_if_not                     { header "__algorithm/find_if_not.h" }
+    module for_each                        { header "__algorithm/for_each.h" }
+    module for_each_n                      { header "__algorithm/for_each_n.h" }
+    module generate                        { header "__algorithm/generate.h" }
+    module generate_n                      { header "__algorithm/generate_n.h" }
+    module half_positive                   { header "__algorithm/half_positive.h" }
+    module in_found_result                 { header "__algorithm/in_found_result.h" }
+    module in_fun_result                   { header "__algorithm/in_fun_result.h" }
+    module in_in_out_result                { header "__algorithm/in_in_out_result.h" }
+    module in_in_result                    { header "__algorithm/in_in_result.h" }
+    module in_out_out_result               { header "__algorithm/in_out_out_result.h" }
+    module includes                        { header "__algorithm/includes.h" }
+    module inplace_merge                   { header "__algorithm/inplace_merge.h" }
+    module is_heap                         { header "__algorithm/is_heap.h" }
+    module is_heap_until                   { header "__algorithm/is_heap_until.h" }
+    module is_partitioned                  { header "__algorithm/is_partitioned.h" }
+    module is_permutation                  { header "__algorithm/is_permutation.h" }
+    module is_sorted                       { header "__algorithm/is_sorted.h" }
+    module is_sorted_until                 { header "__algorithm/is_sorted_until.h" }
+    module lexicographical_compare         { header "__algorithm/lexicographical_compare.h" }
+    module lexicographical_compare_three_way {
+      header "__algorithm/lexicographical_compare_three_way.h"
+    }
+    module lower_bound                     { header "__algorithm/lower_bound.h" }
+    module make_heap                       { header "__algorithm/make_heap.h" }
+    module make_projected                  { header "__algorithm/make_projected.h" }
+    module merge                           { header "__algorithm/merge.h" }
+    module min_max_result                  { header "__algorithm/min_max_result.h" }
+    module minmax                          {
+      header "__algorithm/minmax.h"
+      export *
+    }
+    module minmax_element                  { header "__algorithm/minmax_element.h" }
+    module mismatch                        { header "__algorithm/mismatch.h" }
+    module move_backward                   { header "__algorithm/move_backward.h" }
+    module next_permutation                { header "__algorithm/next_permutation.h" }
+    module none_of                         { header "__algorithm/none_of.h" }
+    module nth_element                     { header "__algorithm/nth_element.h" }
+    module partial_sort                    { header "__algorithm/partial_sort.h" }
+    module partial_sort_copy               { header "__algorithm/partial_sort_copy.h" }
+    module partition                       { header "__algorithm/partition.h" }
+    module partition_copy                  { header "__algorithm/partition_copy.h" }
+    module partition_point                 { header "__algorithm/partition_point.h" }
+    module pop_heap                        { header "__algorithm/pop_heap.h" }
+    module prev_permutation                { header "__algorithm/prev_permutation.h" }
+    module push_heap                       { header "__algorithm/push_heap.h" }
+    module ranges_adjacent_find            { header "__algorithm/ranges_adjacent_find.h" }
+    module ranges_all_of                   { header "__algorithm/ranges_all_of.h" }
+    module ranges_any_of                   { header "__algorithm/ranges_any_of.h" }
+    module ranges_binary_search {
+      private header "__algorithm/ranges_binary_search.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_clamp                    {
+      header "__algorithm/ranges_clamp.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_copy                     {
+      header "__algorithm/ranges_copy.h"
+      export std_algorithm.__algorithm.in_out_result
+    }
+    module ranges_copy_backward            {
+      header "__algorithm/ranges_copy_backward.h"
+      export std_algorithm.__algorithm.in_out_result
+    }
+    module ranges_copy_if                  {
+      header "__algorithm/ranges_copy_if.h"
+      export std_algorithm.__algorithm.in_out_result
+    }
+    module ranges_copy_n                   {
+      header "__algorithm/ranges_copy_n.h"
+      export std_algorithm.__algorithm.in_out_result
+    }
+    module ranges_count                    { header "__algorithm/ranges_count.h" }
+    module ranges_count_if                 { header "__algorithm/ranges_count_if.h" }
+    module ranges_equal                    { header "__algorithm/ranges_equal.h" }
+    module ranges_equal_range              {
+      header "__algorithm/ranges_equal_range.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_fill                     { header "__algorithm/ranges_fill.h" }
+    module ranges_fill_n                   { header "__algorithm/ranges_fill_n.h" }
+    module ranges_find                     { header "__algorithm/ranges_find.h" }
+    module ranges_find_end                 { header "__algorithm/ranges_find_end.h" }
+    module ranges_find_first_of            { header "__algorithm/ranges_find_first_of.h" }
+    module ranges_find_if                  { header "__algorithm/ranges_find_if.h" }
+    module ranges_find_if_not              { header "__algorithm/ranges_find_if_not.h" }
+    module ranges_for_each                 {
+      header "__algorithm/ranges_for_each.h"
+      export std_algorithm.__algorithm.in_fun_result
+    }
+    module ranges_for_each_n               {
+      header "__algorithm/ranges_for_each_n.h"
+      export std_algorithm.__algorithm.in_fun_result
+    }
+    module ranges_generate                 { header "__algorithm/ranges_generate.h" }
+    module ranges_generate_n               { header "__algorithm/ranges_generate_n.h" }
+    module ranges_includes                 {
+      header "__algorithm/ranges_includes.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_inplace_merge            {
+      header "__algorithm/ranges_inplace_merge.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_is_heap                  {
+      header "__algorithm/ranges_is_heap.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_is_heap_until            {
+      header "__algorithm/ranges_is_heap_until.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_is_partitioned           { header "__algorithm/ranges_is_partitioned.h" }
+    module ranges_is_permutation           { header "__algorithm/ranges_is_permutation.h" }
+    module ranges_is_sorted                {
+      header "__algorithm/ranges_is_sorted.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_is_sorted_until          {
+      header "__algorithm/ranges_is_sorted_until.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_lexicographical_compare  {
+      header "__algorithm/ranges_lexicographical_compare.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_lower_bound              {
+      header "__algorithm/ranges_lower_bound.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_make_heap                {
+      header "__algorithm/ranges_make_heap.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_max                      {
+      header "__algorithm/ranges_max.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_max_element              {
+      header "__algorithm/ranges_max_element.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_merge                    {
+      header "__algorithm/ranges_merge.h"
+      export std_algorithm.__algorithm.in_in_out_result
+    }
+    module ranges_min                      {
+      header "__algorithm/ranges_min.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_min_element              {
+      header "__algorithm/ranges_min_element.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_minmax                   {
+      header "__algorithm/ranges_minmax.h"
+      export std___functional_ranges_operations
+      export std_algorithm.__algorithm.min_max_result
+    }
+    module ranges_minmax_element           {
+      header "__algorithm/ranges_minmax_element.h"
+      export std___functional_ranges_operations
+      export std_algorithm.__algorithm.min_max_result
+    }
+    module ranges_mismatch                 {
+      header "__algorithm/ranges_mismatch.h"
+      export std_algorithm.__algorithm.in_in_result
+    }
+    module ranges_move                     {
+      header "__algorithm/ranges_move.h"
+      export std___algorithm_in_out_result
+    }
+    module ranges_move_backward            {
+      header "__algorithm/ranges_move_backward.h"
+      export std___algorithm_in_out_result
+    }
+    module ranges_next_permutation         {
+      header "__algorithm/ranges_next_permutation.h"
+      export std_algorithm.__algorithm.in_found_result
+      export std___functional_ranges_operations
+    }
+    module ranges_none_of                  { header "__algorithm/ranges_none_of.h" }
+    module ranges_nth_element              {
+      header "__algorithm/ranges_nth_element.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_partial_sort             {
+      header "__algorithm/ranges_partial_sort.h"
+      export std___algorithm_in_out_result
+      export std___functional_ranges_operations
+    }
+    module ranges_partial_sort_copy        {
+      header "__algorithm/ranges_partial_sort_copy.h"
+      export std_algorithm.__algorithm.in_out_out_result
+      export std___functional_ranges_operations
+    }
+    module ranges_partition                { header "__algorithm/ranges_partition.h" }
+    module ranges_partition_copy           { header "__algorithm/ranges_partition_copy.h" }
+    module ranges_partition_point          { header "__algorithm/ranges_partition_point.h" }
+    module ranges_pop_heap                 {
+      header "__algorithm/ranges_pop_heap.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_prev_permutation         {
+      header "__algorithm/ranges_prev_permutation.h"
+      export std_algorithm.__algorithm.in_found_result
+      export std___functional_ranges_operations
+    }
+    module ranges_push_heap                {
+      header "__algorithm/ranges_push_heap.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_remove                   { header "__algorithm/ranges_remove.h" }
+    module ranges_remove_copy              {
+      header "__algorithm/ranges_remove_copy.h"
+      export std___algorithm_in_out_result
+    }
+    module ranges_remove_copy_if           {
+      header "__algorithm/ranges_remove_copy_if.h"
+      export std___algorithm_in_out_result
+    }
+    module ranges_remove_if                { header "__algorithm/ranges_remove_if.h" }
+    module ranges_replace                  { header "__algorithm/ranges_replace.h" }
+    module ranges_replace_copy             {
+      header "__algorithm/ranges_replace_copy.h"
+      export std___algorithm_in_out_result
+    }
+    module ranges_replace_copy_if          {
+      header "__algorithm/ranges_replace_copy_if.h"
+      export std___algorithm_in_out_result
+    }
+    module ranges_replace_if               { header "__algorithm/ranges_replace_if.h" }
+    module ranges_reverse                  { header "__algorithm/ranges_reverse.h" }
+    module ranges_reverse_copy             {
+      header "__algorithm/ranges_reverse_copy.h"
+      export std___algorithm_in_out_result
+    }
+    module ranges_rotate                   { header "__algorithm/ranges_rotate.h" }
+    module ranges_rotate_copy              {
+      header "__algorithm/ranges_rotate_copy.h"
+      export std___algorithm_in_out_result
+    }
+    module ranges_sample                   { header "__algorithm/ranges_sample.h" }
+    module ranges_search                   { header "__algorithm/ranges_search.h" }
+    module ranges_search_n                 { header "__algorithm/ranges_search_n.h" }
+    module ranges_set_difference           {
+      header "__algorithm/ranges_set_difference.h"
+      export std___algorithm_in_out_result
+    }
+    module ranges_set_intersection         {
+      header "__algorithm/ranges_set_intersection.h"
+      export std_algorithm.__algorithm.in_in_out_result
+    }
+    module ranges_set_symmetric_difference {
+      header "__algorithm/ranges_set_symmetric_difference.h"
+      export std_algorithm.__algorithm.in_in_out_result
+      export std___functional_ranges_operations
+    }
+    module ranges_set_union                {
+      header "__algorithm/ranges_set_union.h"
+      export std_algorithm.__algorithm.in_in_out_result
+      export std___functional_ranges_operations
+    }
+    module ranges_shuffle                  { header "__algorithm/ranges_shuffle.h" }
+    module ranges_sort                     {
+      header "__algorithm/ranges_sort.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_sort_heap                {
+      header "__algorithm/ranges_sort_heap.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_stable_partition         { header "__algorithm/ranges_stable_partition.h" }
+    module ranges_stable_sort              {
+      header "__algorithm/ranges_stable_sort.h"
+      export std___functional_ranges_operations
+    }
+    module ranges_swap_ranges              {
+      header "__algorithm/ranges_swap_ranges.h"
+      export std_algorithm.__algorithm.in_in_result
+    }
+    module ranges_transform                {
+      header "__algorithm/ranges_transform.h"
+      export std_algorithm.__algorithm.in_in_out_result
+      export std___algorithm_in_out_result
+    }
+    module uniform_random_bit_generator_adaptor {
+      header "__algorithm/uniform_random_bit_generator_adaptor.h"
+    }
+    module ranges_unique                   { header "__algorithm/ranges_unique.h" }
+    module ranges_unique_copy              {
+      header "__algorithm/ranges_unique_copy.h"
+      export std___algorithm_in_out_result
+    }
+    module ranges_upper_bound              {
+      header "__algorithm/ranges_upper_bound.h"
+      export std___functional_ranges_operations
+    }
+    module remove                          { header "__algorithm/remove.h" }
+    module remove_copy                     { header "__algorithm/remove_copy.h" }
+    module remove_copy_if                  { header "__algorithm/remove_copy_if.h" }
+    module remove_if                       { header "__algorithm/remove_if.h" }
+    module replace                         { header "__algorithm/replace.h" }
+    module replace_copy                    { header "__algorithm/replace_copy.h" }
+    module replace_copy_if                 { header "__algorithm/replace_copy_if.h" }
+    module replace_if                      { header "__algorithm/replace_if.h" }
+    module reverse                         { header "__algorithm/reverse.h" }
+    module reverse_copy                    { header "__algorithm/reverse_copy.h" }
+    module rotate                          { header "__algorithm/rotate.h" }
+    module rotate_copy                     { header "__algorithm/rotate_copy.h" }
+    module sample                          { header "__algorithm/sample.h" }
+    module search_n                        { header "__algorithm/search_n.h" }
+    module set_difference                  { header "__algorithm/set_difference.h" }
+    module set_intersection                { header "__algorithm/set_intersection.h" }
+    module set_symmetric_difference        { header "__algorithm/set_symmetric_difference.h" }
+    module set_union                       { header "__algorithm/set_union.h" }
+    module shift_left                      { header "__algorithm/shift_left.h" }
+    module shift_right                     { header "__algorithm/shift_right.h" }
+    module shuffle                         { header "__algorithm/shuffle.h" }
+    module sift_down                       { header "__algorithm/sift_down.h" }
+    module sort                            { header "__algorithm/sort.h" }
+    module sort_heap                       { header "__algorithm/sort_heap.h" }
+    module stable_partition                { header "__algorithm/stable_partition.h" }
+    module stable_sort                     { header "__algorithm/stable_sort.h" }
+    module swap_ranges                     { header "__algorithm/swap_ranges.h" }
+    module three_way_comp_ref_type         { header "__algorithm/three_way_comp_ref_type.h" }
+    module transform                       { header "__algorithm/transform.h" }
+    module unique                          { header "__algorithm/unique.h" }
+    module unique_copy                     { header "__algorithm/unique_copy.h" }
+    module upper_bound                     { header "__algorithm/upper_bound.h" }
+  }
+}
+module std___algorithm_comp                            [system] { header "__algorithm/comp.h" }
+module std___algorithm_comp_ref_type                   [system] { header "__algorithm/comp_ref_type.h" }
+module std___algorithm_copy                            [system] { header "__algorithm/copy.h" }
+module std___algorithm_copy_move_common                [system] { header "__algorithm/copy_move_common.h" }
+module std___algorithm_copy_n                          [system] { header "__algorithm/copy_n.h" }
+module std___algorithm_fill_n                          [system] { header "__algorithm/fill_n.h" }
+module std___algorithm_find_end                        [system] { header "__algorithm/find_end.h" }
+module std___algorithm_find_first_of                   [system] { header "__algorithm/find_first_of.h" }
+module std___algorithm_in_out_result                   [system] { header "__algorithm/in_out_result.h" }
+module std___algorithm_iter_swap                       [system] { header "__algorithm/iter_swap.h" }
+module std___algorithm_iterator_operations             [system] {
+  header "__algorithm/iterator_operations.h"
+  export *
+}
+module std___algorithm_max                             [system] { header "__algorithm/max.h" }
+module std___algorithm_max_element                     [system] { header "__algorithm/max_element.h" }
+module std___algorithm_min                             [system] { header "__algorithm/min.h" }
+module std___algorithm_min_element                     [system] { header "__algorithm/min_element.h" }
+module std___algorithm_move                            [system] { header "__algorithm/move.h" }
+module std___algorithm_ranges_iterator_concept         [system] { header "__algorithm/ranges_iterator_concept.h" }
+module std___algorithm_search                          [system] { header "__algorithm/search.h" }
+module std___algorithm_unwrap_iter                     [system] { header "__algorithm/unwrap_iter.h" }
+module std___algorithm_unwrap_range                    [system] {
+  header "__algorithm/unwrap_range.h"
+  export std_utility.__utility.pair
+}
+module std_array [system] {
+  header "array"
+//  export std_initializer_list
+  export *
+}
+module std___array_array_fwd [system] { header "__fwd/array.h" }
+module std_atomic [system] {
+  header "atomic"
+  export *
+
+  module __atomic {
+    module aliases             { header "__atomic/aliases.h" }
+    module atomic              { header "__atomic/atomic.h" }
+    module atomic_base         { header "__atomic/atomic_base.h" }
+    module atomic_flag         { header "__atomic/atomic_flag.h" }
+    module atomic_init         { header "__atomic/atomic_init.h" }
+    module atomic_lock_free    { header "__atomic/atomic_lock_free.h" }
+    module atomic_sync         { header "__atomic/atomic_sync.h" }
+    module check_memory_order  { header "__atomic/check_memory_order.h" }
+    module contention_t        { header "__atomic/contention_t.h" }
+    module cxx_atomic_impl     { header "__atomic/cxx_atomic_impl.h" }
+    module fence               { header "__atomic/fence.h" }
+    module is_always_lock_free { header "__atomic/is_always_lock_free.h" }
+    module kill_dependency     { header "__atomic/kill_dependency.h" }
+    module memory_order        { header "__atomic/memory_order.h" }
+  }
+}
+module std_bit [system] {
+  header "bit"
+  export *
+
+  module __bit {
+    module bit_cast       { header "__bit/bit_cast.h" }
+    module bit_ceil       { header "__bit/bit_ceil.h" }
+    module bit_floor      { header "__bit/bit_floor.h" }
+    module bit_log2       { header "__bit/bit_log2.h" }
+    module bit_width      { header "__bit/bit_width.h" }
+    module blsr           { header "__bit/blsr.h" }
+    module byteswap       { header "__bit/byteswap.h" }
+    module countl         { header "__bit/countl.h" }
+    module countr         { header "__bit/countr.h" }
+    module endian         { header "__bit/endian.h" }
+    module has_single_bit { header "__bit/has_single_bit.h" }
+    module popcount       { header "__bit/popcount.h" }
+    module rotate         { header "__bit/rotate.h" }
+  }
+}
+module std_bitset [system] {
+  header "bitset"
+//  export std_string
+//  export std_iosfwd
+  export *
+}
+module std_charconv [system] {
+  header "charconv"
+  export *
+
+  module __charconv {
+    module chars_format      { header "__charconv/chars_format.h" }
+    module from_chars_result { header "__charconv/from_chars_result.h" }
+    module tables            { header "__charconv/tables.h" }
+    module to_chars_base_10  { header "__charconv/to_chars_base_10.h" }
+    module to_chars_result   { header "__charconv/to_chars_result.h" }
+  }
+
+}
+module std_chrono [system] {
+  header "chrono"
+  export *
+
+  module __chrono {
+    module calendar               { header "__chrono/calendar.h" }
+    module concepts               { header "__chrono/concepts.h" }
+    module convert_to_tm          { header "__chrono/convert_to_tm.h" }
+    module day                    { header "__chrono/day.h" }
+    module file_clock             { header "__chrono/file_clock.h" }
+    module formatter              {
+      @requires_LIBCXX_ENABLE_LOCALIZATION@
+      header "__chrono/formatter.h"
+    }
+    module hh_mm_ss               { header "__chrono/hh_mm_ss.h" }
+    module literals               { header "__chrono/literals.h" }
+    module month                  { header "__chrono/month.h" }
+    module month_weekday          { header "__chrono/month_weekday.h" }
+    module monthday               { header "__chrono/monthday.h" }
+    module ostream                {
+      @requires_LIBCXX_ENABLE_LOCALIZATION@
+      header "__chrono/ostream.h"
+    }
+    module parser_std_format_spec {
+      @requires_LIBCXX_ENABLE_LOCALIZATION@
+      header "__chrono/parser_std_format_spec.h"
+    }
+    module weekday                { header "__chrono/weekday.h" }
+    module year                   { header "__chrono/year.h" }
+    module year_month             { header "__chrono/year_month.h" }
+    module year_month_day         { header "__chrono/year_month_day.h" }
+    module year_month_weekday     { header "__chrono/year_month_weekday.h" }
+  }
+}
+module std___chrono_convert_to_timespec    [system] { header "__chrono/convert_to_timespec.h" }
+module std___chrono_duration               [system] { header "__chrono/duration.h" }
+module std___chrono_high_resolution_clock  [system] {
+  header "__chrono/high_resolution_clock.h"
+  export std___chrono_steady_clock
+  export std___chrono_system_clock
+  export std___chrono_time_point
+}
+module std___chrono_statically_widen       [system] { header "__chrono/statically_widen.h" }
+module std___chrono_steady_clock           [system] { header "__chrono/steady_clock.h" }
+module std___chrono_system_clock           [system] { header "__chrono/system_clock.h" }
+module std___chrono_time_point             [system] { header "__chrono/time_point.h" }
+module std_compare [system] {
+  header "compare"
+  export *
+
+  module __compare {
+    module common_comparison_category     { header "__compare/common_comparison_category.h" }
+    module compare_partial_order_fallback { header "__compare/compare_partial_order_fallback.h" }
+    module compare_strong_order_fallback  { header "__compare/compare_strong_order_fallback.h" }
+    module compare_three_way              { header "__compare/compare_three_way.h" }
+    module compare_three_way_result       { header "__compare/compare_three_way_result.h" }
+    module compare_weak_order_fallback    { header "__compare/compare_weak_order_fallback.h" }
+    module is_eq                          { header "__compare/is_eq.h" }
+    module ordering                       { header "__compare/ordering.h" }
+    module partial_order                  { header "__compare/partial_order.h" }
+    module strong_order                   { header "__compare/strong_order.h" }
+    module synth_three_way                { header "__compare/synth_three_way.h" }
+    module three_way_comparable           { header "__compare/three_way_comparable.h" }
+    module weak_order                     { header "__compare/weak_order.h" }
+  }
+}
+module std_complex [system] {
+  header "complex"
+  export *
+}
+module std_concepts [system] {
+  header "concepts"
+  export *
+
+  module __concepts {
+    module arithmetic                 { header "__concepts/arithmetic.h" }
+    module assignable                 { header "__concepts/assignable.h" }
+    module boolean_testable           { header "__concepts/boolean_testable.h" }
+    module class_or_enum              { header "__concepts/class_or_enum.h" }
+    module common_reference_with      { header "__concepts/common_reference_with.h" }
+    module common_with                { header "__concepts/common_with.h" }
+    module constructible              { header "__concepts/constructible.h" }
+    module convertible_to             { header "__concepts/convertible_to.h" }
+    module copyable                   { header "__concepts/copyable.h" }
+    module derived_from               { header "__concepts/derived_from.h" }
+    module destructible               { header "__concepts/destructible.h" }
+    module different_from             { header "__concepts/different_from.h" }
+    module equality_comparable        {
+      header "__concepts/equality_comparable.h"
+      export std_type_traits.common_reference
+    }
+    module invocable                  { header "__concepts/invocable.h" }
+    module movable                    { header "__concepts/movable.h" }
+    module predicate                  { header "__concepts/predicate.h" }
+    module regular                    { header "__concepts/regular.h" }
+    module relation                   { header "__concepts/relation.h" }
+    module same_as                    {
+      header "__concepts/same_as.h"
+      export std___type_traits_is_same
+    }
+    module semiregular                { header "__concepts/semiregular.h" }
+    module swappable                  { header "__concepts/swappable.h" }
+    module totally_ordered            { header "__concepts/totally_ordered.h" }
+  }
+}
+module std_deque [system] {
+  header "deque"
+//  export std_initializer_list
+  export *
+}
+module std_exception [system] {
+  header "exception"
+  export *
+}
+module std_format [system] {
+  header "format"
+  export *
+
+  module __format {
+    module buffer                          { header "__format/buffer.h" }
+    module container_adaptor               { header "__format/container_adaptor.h" }
+    module escaped_output_table            { header "__format/escaped_output_table.h" }
+    module extended_grapheme_cluster_table { header "__format/extended_grapheme_cluster_table.h" }
+    module format_arg                      { header "__format/format_arg.h" }
+    module format_arg_store                { header "__format/format_arg_store.h" }
+    module format_args                     { header "__format/format_args.h" }
+    module format_context {
+      header "__format/format_context.h"
+//      export std_optional
+//      export std_locale
+      export *
+    }
+    module format_functions                {
+      header "__format/format_functions.h"
+      export std_string
+    }
+    module format_string                   { header "__format/format_string.h" }
+    module format_to_n_result {
+      header "__format/format_to_n_result.h"
+      export std___iterator_incrementable_traits
+    }
+    module formatter_bool                  { header "__format/formatter_bool.h" }
+    module formatter_char                  { header "__format/formatter_char.h" }
+    module formatter_floating_point        { header "__format/formatter_floating_point.h" }
+    module formatter_integer               { header "__format/formatter_integer.h" }
+    module formatter_integral              { header "__format/formatter_integral.h" }
+    module formatter_output                { header "__format/formatter_output.h" }
+    module formatter_pointer               { header "__format/formatter_pointer.h" }
+    module formatter_string                { header "__format/formatter_string.h" }
+    module formatter_tuple                 { header "__format/formatter_tuple.h" }
+    module parser_std_format_spec          { header "__format/parser_std_format_spec.h" }
+    module range_default_formatter         { header "__format/range_default_formatter.h" }
+    module range_formatter                 { header "__format/range_formatter.h" }
+    module unicode                         { header "__format/unicode.h" }
+  }
+}
+module std___format_concepts                        [system] { header "__format/concepts.h" }
+module std___format_enable_insertable               [system] { header "__format/enable_insertable.h" }
+module std___format_format_error                    [system] { header "__format/format_error.h" }
+module std___format_format_fwd                      [system] { header "__format/format_fwd.h" }
+module std___format_format_parse_context            [system] { header "__format/format_parse_context.h" }
+module std___format_formatter                       [system] { header "__format/formatter.h" }
+module std_functional {
+  header "functional"
+  export *
+
+  module __functional {
+    module binary_negate              { header "__functional/binary_negate.h" }
+    module bind                       { header "__functional/bind.h" }
+    module bind_back                  { header "__functional/bind_back.h" }
+    module bind_front                 { header "__functional/bind_front.h" }
+    module binder1st                  { header "__functional/binder1st.h" }
+    module binder2nd                  { header "__functional/binder2nd.h" }
+    module boyer_moore_searcher       { header "__functional/boyer_moore_searcher.h" }
+    module compose                    { header "__functional/compose.h" }
+    module default_searcher           { header "__functional/default_searcher.h" }
+    module function                   { header "__functional/function.h" }
+    module mem_fn                     { header "__functional/mem_fn.h" }
+    module mem_fun_ref                { header "__functional/mem_fun_ref.h" }
+    module not_fn                     { header "__functional/not_fn.h" }
+    module perfect_forward            { header "__functional/perfect_forward.h" }
+    module pointer_to_binary_function { header "__functional/pointer_to_binary_function.h" }
+    module pointer_to_unary_function  { header "__functional/pointer_to_unary_function.h" }
+    module unary_negate               { header "__functional/unary_negate.h" }
+  }
+}
+module std___functional_binary_function            [system] { header "__functional/binary_function.h" }
+module std___functional_hash                       [system] { header "__functional/hash.h" }
+module std___functional_hash_fwd                   [system] { header "__fwd/hash.h" }
+module std___functional_identity                   [system] { header "__functional/identity.h" }
+module std___functional_invoke                     [system] {
+  header "__functional/invoke.h"
+  export std_type_traits
+}
+module std___functional_is_transparent             [system] { header "__functional/is_transparent.h" }
+module std___functional_operations                 [system] { header "__functional/operations.h" }
+module std___functional_ranges_operations          [system] { header "__functional/ranges_operations.h" }
+module std___functional_reference_wrapper          [system] { header "__functional/reference_wrapper.h" }
+module std___functional_unary_function             [system] { header "__functional/unary_function.h" }
+module std___functional_unwrap_ref                 [system] { header "__functional/unwrap_ref.h" }
+module std___functional_weak_result_type           [system] { header "__functional/weak_result_type.h" }
+module std_initializer_list [system] {
+  header "initializer_list"
+  export *
+}
+module std_ios [system] {
+  @requires_LIBCXX_ENABLE_LOCALIZATION@
+  header "ios"
+//  export std_iosfwd
+  export *
+}
+module std___ios_fpos [system] { header "__ios/fpos.h" }
+module std_iosfwd [system] {
+  header "iosfwd"
+  export *
+}
+module std_istream [system] {
+  @requires_LIBCXX_ENABLE_LOCALIZATION@
+  header "istream"
+  // FIXME: should re-export ios, streambuf?
+  export *
+}
+module std_iterator [system] {
+  header "iterator"
+  export *
+
+  module __iterator {
+    module back_insert_iterator  { header "__iterator/back_insert_iterator.h" }
+    module bounded_iter          { header "__iterator/bounded_iter.h" }
+    module common_iterator       { header "__iterator/common_iterator.h" }
+    module counted_iterator      { header "__iterator/counted_iterator.h" }
+    module data                  { header "__iterator/data.h" }
+    module default_sentinel      { header "__iterator/default_sentinel.h" }
+    module distance              { header "__iterator/distance.h" }
+    module empty                 { header "__iterator/empty.h" }
+    module erase_if_container    { header "__iterator/erase_if_container.h" }
+    module front_insert_iterator { header "__iterator/front_insert_iterator.h" }
+    module indirectly_comparable { header "__iterator/indirectly_comparable.h" }
+    module insert_iterator       { header "__iterator/insert_iterator.h" }
+    module istream_iterator      { header "__iterator/istream_iterator.h" }
+    module istreambuf_iterator   { header "__iterator/istreambuf_iterator.h" }
+    module iter_swap             { header "__iterator/iter_swap.h" }
+    module iterator              { header "__iterator/iterator.h" }
+    module iterator_with_data    { header "__iterator/iterator_with_data.h" }
+    module mergeable             {
+      header "__iterator/mergeable.h"
+      export std___functional_ranges_operations
+    }
+    module move_iterator         { header "__iterator/move_iterator.h" }
+    module move_sentinel         { header "__iterator/move_sentinel.h" }
+    module next                  { header "__iterator/next.h" }
+    module ostream_iterator      { header "__iterator/ostream_iterator.h" }
+    module ostreambuf_iterator   {
+      header "__iterator/ostreambuf_iterator.h"
+      export std_iosfwd
+    }
+    module permutable            { header "__iterator/permutable.h" }
+    module projected             { header "__iterator/projected.h" }
+    module reverse_access        { header "__iterator/reverse_access.h" }
+    module reverse_iterator      { header "__iterator/reverse_iterator.h" }
+    module segmented_iterator    { header "__iterator/segmented_iterator.h" }
+    module size                  { header "__iterator/size.h" }
+    module sortable              {
+      header "__iterator/sortable.h"
+      export std___functional_ranges_operations
+    }
+    module unreachable_sentinel  { header "__iterator/unreachable_sentinel.h" }
+    module wrap_iter             { header "__iterator/wrap_iter.h" }
+  }
+}
+module std___iterator [system] {
+  module iterator_traits       [system] { header "__iterator/iterator_traits.h" }
+  module readable_traits       [system] {
+    header "__iterator/readable_traits.h"
+    export std___iterator.iterator_traits
+  }
+}
+module std___iterator_access                [system] { header "__iterator/access.h" }
+module std___iterator_advance               [system] { header "__iterator/advance.h" }
+module std___iterator_concepts              [system] {
+  header "__iterator/concepts.h"
+  export std_concepts.__concepts.equality_comparable
+  export std_type_traits.common_reference
+}
+module std___iterator_incrementable_traits  [system] { header "__iterator/incrementable_traits.h" }
+module std___iterator_iter_move             [system] { header "__iterator/iter_move.h" }
+module std___iterator_prev                  [system] { header "__iterator/prev.h" }
+module std___debug_utils [system] {
+  module randomize_range { header "__debug_utils/randomize_range.h" }
+}
+module std_limits [system] {
+  header "limits"
+  export *
+}
+module std_locale [system] {
+  @requires_LIBCXX_ENABLE_LOCALIZATION@
+  header "locale"
+  export *
+}
+module std_memory [system] {
+  header "memory"
+  export *
+
+  module __memory {
+    module align                           { header "__memory/align.h" }
+    module aligned_alloc                   { header "__memory/aligned_alloc.h" }
+    module allocate_at_least               { header "__memory/allocate_at_least.h" }
+    module allocation_guard                { header "__memory/allocation_guard.h" }
+    module allocator                       { header "__memory/allocator.h" }
+    module allocator_destructor            { header "__memory/allocator_destructor.h" }
+    module assume_aligned                  { header "__memory/assume_aligned.h" }
+    module auto_ptr                        { header "__memory/auto_ptr.h" }
+    module builtin_new_allocator           { header "__memory/builtin_new_allocator.h" }
+    module compressed_pair                 { header "__memory/compressed_pair.h" }
+    module concepts                        {
+      header "__memory/concepts.h"
+      export std___type_traits_remove_reference
+    }
+    module destruct_n                      { header "__memory/destruct_n.h" }
+    module ranges_construct_at             { header "__memory/ranges_construct_at.h" }
+    module ranges_uninitialized_algorithms {
+      header "__memory/ranges_uninitialized_algorithms.h"
+      export std___algorithm_in_out_result
+    }
+    module raw_storage_iterator            { header "__memory/raw_storage_iterator.h" }
+    module shared_ptr                      { header "__memory/shared_ptr.h" }
+    module swap_allocator                  { header "__memory/swap_allocator.h" }
+    module temp_value                      { header "__memory/temp_value.h" }
+    module temporary_buffer                { header "__memory/temporary_buffer.h" }
+    module uninitialized_algorithms        { header "__memory/uninitialized_algorithms.h" }
+    module unique_ptr                      { header "__memory/unique_ptr.h" }
+    module uses_allocator_construction     { header "__memory/uses_allocator_construction.h" }
+  }
+}
+module std___memory_addressof                       [system] { header "__memory/addressof.h" }
+module std___memory_allocator_arg_t                 [system] { header "__memory/allocator_arg_t.h" }
+module std___memory_allocator_traits                [system] { header "__memory/allocator_traits.h" }
+module std___memory_construct_at                    [system] { header "__memory/construct_at.h" }
+module std___memory_pointer_traits                  [system] { header "__memory/pointer_traits.h" }
+module std___memory_uses_allocator                  [system] { header "__memory/uses_allocator.h" }
+module std___memory_voidify                         [system] { header "__memory/voidify.h" }
+module std___memory_resource_memory_resource              [system] { header "__memory_resource/memory_resource.h" }
+module std___memory_resource_memory_resource_fwd          [system] { header "__fwd/memory_resource.h" }
+module std___memory_resource_polymorphic_allocator        [system] { header "__memory_resource/polymorphic_allocator.h" }
+module std_mutex [system] {
+  @requires_LIBCXX_ENABLE_THREADS@
+  header "mutex"
+  export *
+}
+module std_new [system] {
+  header "new"
+  export *
+}
+module std_optional [system] {
+  header "optional"
+  export *
+}
+module std_queue [system] {
+  header "queue"
+//  export std_initializer_list
+  export *
+}
+module std_ostream [system] {
+  @requires_LIBCXX_ENABLE_LOCALIZATION@
+  header "ostream"
+  // FIXME: should re-export ios, streambuf?
+  export *
+}
+module std___random_is_valid                        [system] { header "__random/is_valid.h" }
+module std___random_log2                            [system] { header "__random/log2.h" }
+module std___random_uniform_int_distribution        [system] { header "__random/uniform_int_distribution.h" }
+module std___random_uniform_random_bit_generator    [system] { header "__random/uniform_random_bit_generator.h" }
+module std___ranges_access                 [system] { header "__ranges/access.h" }
+module std___ranges_concepts               [system] { header "__ranges/concepts.h" }
+module std___ranges_dangling               [system] { header "__ranges/dangling.h" }
+module std___ranges_data                   [system] { header "__ranges/data.h" }
+module std___ranges_empty                  [system] { header "__ranges/empty.h" }
+module std___ranges_enable_borrowed_range  [system] { header "__ranges/enable_borrowed_range.h" }
+module std___ranges_enable_view            [system] { header "__ranges/enable_view.h" }
+module std___ranges_size                   [system] { header "__ranges/size.h" }
+module std___ranges_subrange               [system] {
+  header "__ranges/subrange.h"
+  export std___ranges_subrange_subrange_fwd
+}
+module std___ranges_subrange_subrange_fwd [system] { header "__fwd/subrange.h" }
+module std___ranges_view_interface         [system] { header "__ranges/view_interface.h" }
+module std_ratio [system] {
+  header "ratio"
+  export *
+}
+module std_sstream [system] {
+  @requires_LIBCXX_ENABLE_LOCALIZATION@
+  header "sstream"
+  // FIXME: should re-export istream, ostream, ios, streambuf, string?
+  export *
+}
+module std_stack [system] {
+  header "stack"
+//  export std_initializer_list
+  export *
+}
+module std_stdexcept [system] {
+  header "stdexcept"
+  export *
+}
+module std_streambuf [system] {
+  @requires_LIBCXX_ENABLE_LOCALIZATION@
+  header "streambuf"
+  export *
+}
+module std_string [system] {
+  header "string"
+//  export std_initializer_list
+//  export std_string_view
+  module __string {
+    module extern_template_lists { header "__string/extern_template_lists.h" }
+  }
+  export *
+}
+module std___string_char_traits           [system] { header "__string/char_traits.h" }
+module std___string_constexpr_c_functions [system] { header "__string/constexpr_c_functions.h" }
+module std___string_string_fwd            [system] { header "__fwd/string.h" }
+module std_string_view [system] {
+  header "string_view"
+//  export std_initializer_list
+  export *
+}
+module std___string_view_string_view_fwd [system] { header "__fwd/string_view.h" }
+module std_system_error [system] {
+  header "system_error"
+  export *
+}
+module std___thread_poll_with_backoff    [system] { header "__thread/poll_with_backoff.h" }
+module std___thread_timed_backoff_policy [system] { header "__thread/timed_backoff_policy.h" }
+module std_tuple [system] {
+  header "tuple"
+  export *
+
+  module pair_like        { header "__tuple_dir/pair_like.h" }
+}
+module std___tuple_apply_cv         [system] { header "__tuple_dir/apply_cv.h" }
+module std___tuple_get_fwd          [system] { header "__fwd/get.h" }
+module std___tuple_make_tuple_types [system] { header "__tuple_dir/make_tuple_types.h" }
+module std___tuple_sfinae_helpers   [system] { header "__tuple_dir/sfinae_helpers.h" }
+module std___tuple_tuple_element    [system] { header "__tuple_dir/tuple_element.h" }
+module std___tuple_tuple_fwd        [system] { header "__fwd/tuple.h" }
+module std___tuple_tuple_indices    [system] { header "__tuple_dir/tuple_indices.h" }
+module std___tuple_tuple_like       [system] { header "__tuple_dir/tuple_like.h" }
+module std___tuple_tuple_like_ext   [system] { header "__tuple_dir/tuple_like_ext.h" }
+module std___tuple_tuple_size       [system] { header "__tuple_dir/tuple_size.h" }
+module std___tuple_tuple_types      [system] { header "__tuple_dir/tuple_types.h" }
+module std_type_traits [system] {
+  header "type_traits"
+//  export std___functional_unwrap_ref
+  export *
+
+  module add_cv                              { header "__type_traits/add_cv.h" }
+  module add_volatile                        { header "__type_traits/add_volatile.h" }
+  module aligned_storage                     { header "__type_traits/aligned_storage.h" }
+  module aligned_union                       { header "__type_traits/aligned_union.h" }
+  module can_extract_key                     { header "__type_traits/can_extract_key.h" }
+  module common_reference                    { header "__type_traits/common_reference.h" }
+  module common_type                         { header "__type_traits/common_type.h" }
+  module copy_cv                             { header "__type_traits/copy_cv.h" }
+  module copy_cvref                          { header "__type_traits/copy_cvref.h" }
+  module dependent_type                      { header "__type_traits/dependent_type.h" }
+  module disjunction                         { header "__type_traits/disjunction.h" }
+  module extent                              { header "__type_traits/extent.h" }
+  module has_unique_object_representation    { header "__type_traits/has_unique_object_representation.h" }
+  module has_virtual_destructor              { header "__type_traits/has_virtual_destructor.h" }
+  module is_abstract                         { header "__type_traits/is_abstract.h" }
+  module is_aggregate                        { header "__type_traits/is_aggregate.h" }
+  module is_allocator                        { header "__type_traits/is_allocator.h" }
+  module is_always_bitcastable               { header "__type_traits/is_always_bitcastable.h" }
+  module is_assignable                       { header "__type_traits/is_assignable.h" }
+  module is_bounded_array                    { header "__type_traits/is_bounded_array.h" }
+  module is_callable                         { header "__type_traits/is_callable.h" }
+  module is_char_like_type                   { header "__type_traits/is_char_like_type.h" }
+  module is_compound                         { header "__type_traits/is_compound.h" }
+  module is_constant_evaluated               { header "__type_traits/is_constant_evaluated.h" }
+  module is_copy_assignable                  { header "__type_traits/is_copy_assignable.h" }
+  module is_default_constructible            { header "__type_traits/is_default_constructible.h" }
+  module is_destructible                     { header "__type_traits/is_destructible.h" }
+  module is_equality_comparable                       {
+    header "__type_traits/is_equality_comparable.h"
+    export std___type_traits_integral_constant
+  }
+  module is_fundamental                      { header "__type_traits/is_fundamental.h" }
+  module is_implicitly_default_constructible { header "__type_traits/is_implicitly_default_constructible.h" }
+  module is_literal_type                     { header "__type_traits/is_literal_type.h" }
+  module is_member_pointer                   { header "__type_traits/is_member_pointer.h" }
+  module is_move_assignable                  { header "__type_traits/is_move_assignable.h" }
+  module is_nothrow_assignable               { header "__type_traits/is_nothrow_assignable.h" }
+  module is_nothrow_convertible              { header "__type_traits/is_nothrow_convertible.h" }
+  module is_nothrow_copy_assignable          { header "__type_traits/is_nothrow_copy_assignable.h" }
+  module is_nothrow_copy_constructible       { header "__type_traits/is_nothrow_copy_constructible.h" }
+  module is_nothrow_default_constructible    { header "__type_traits/is_nothrow_default_constructible.h" }
+  module is_nothrow_destructible             { header "__type_traits/is_nothrow_destructible.h" }
+  module is_nothrow_move_assignable          { header "__type_traits/is_nothrow_move_assignable.h" }
+  module is_null_pointer                     { header "__type_traits/is_null_pointer.h" }
+  module is_object                           { header "__type_traits/is_object.h" }
+  module is_pod                              { header "__type_traits/is_pod.h" }
+  module is_pointer                          { header "__type_traits/is_pointer.h" }
+  module is_primary_template                 { header "__type_traits/is_primary_template.h" }
+  module is_scalar                           { header "__type_traits/is_scalar.h" }
+  module is_scoped_enum                      { header "__type_traits/is_scoped_enum.h" }
+  module is_signed_integer                   { header "__type_traits/is_signed_integer.h" }
+  module is_specialization                   { header "__type_traits/is_specialization.h" }
+  module is_standard_layout                  { header "__type_traits/is_standard_layout.h" }
+  module is_swappable                        { header "__type_traits/is_swappable.h" }
+  module is_trivial                          { header "__type_traits/is_trivial.h" }
+  module is_trivially_assignable             { header "__type_traits/is_trivially_assignable.h" }
+  module is_trivially_constructible          { header "__type_traits/is_trivially_constructible.h" }
+  module is_trivially_copy_assignable        { header "__type_traits/is_trivially_copy_assignable.h" }
+  module is_trivially_copy_constructible     { header "__type_traits/is_trivially_copy_constructible.h" }
+  module is_trivially_copyable               { header "__type_traits/is_trivially_copyable.h" }
+  module is_trivially_default_constructible  { header "__type_traits/is_trivially_default_constructible.h" }
+  module is_trivially_destructible           { header "__type_traits/is_trivially_destructible.h" }
+  module is_trivially_move_assignable        { header "__type_traits/is_trivially_move_assignable.h" }
+  module is_trivially_move_constructible     { header "__type_traits/is_trivially_move_constructible.h" }
+  module is_unbounded_array                  { header "__type_traits/is_unbounded_array.h" }
+  module is_union                            { header "__type_traits/is_union.h" }
+  module is_unsigned_integer                 { header "__type_traits/is_unsigned_integer.h" }
+  module is_valid_expansion                  { header "__type_traits/is_valid_expansion.h" }
+  module lazy                                { header "__type_traits/lazy.h" }
+  module make_32_64_or_128_bit               { header "__type_traits/make_32_64_or_128_bit.h" }
+  module make_const_lvalue_ref               { header "__type_traits/make_const_lvalue_ref.h" }
+  module make_signed                         { header "__type_traits/make_signed.h" }
+  module maybe_const                         { header "__type_traits/maybe_const.h" }
+  module negation                            { header "__type_traits/negation.h" }
+  module noexcept_move_assign_container      { header "__type_traits/noexcept_move_assign_container.h" }
+  module predicate_traits                    { header "__type_traits/predicate_traits.h" }
+  module promote                             { header "__type_traits/promote.h" }
+  module rank                                { header "__type_traits/rank.h" }
+  module remove_all_extents                  { header "__type_traits/remove_all_extents.h" }
+  module remove_const_ref                    { header "__type_traits/remove_const_ref.h" }
+  module remove_cvref                        { header "__type_traits/remove_cvref.h" }
+  module remove_pointer                      { header "__type_traits/remove_pointer.h" }
+  module result_of                           { header "__type_traits/result_of.h" }
+  module strip_signature                     { header "__type_traits/strip_signature.h" }
+  module type_identity                       { header "__type_traits/type_identity.h" }
+  module underlying_type                     {
+    header "__type_traits/underlying_type.h"
+
+    export std_type_traits
+  }
+}
+module std___type_traits_add_const                           [system] { header "__type_traits/add_const.h" }
+module std___type_traits_add_lvalue_reference                [system] { header "__type_traits/add_lvalue_reference.h" }
+module std___type_traits_add_pointer                         [system] { header "__type_traits/add_pointer.h" }
+module std___type_traits_add_rvalue_reference                [system] { header "__type_traits/add_rvalue_reference.h" }
+module std___type_traits_alignment_of                        [system] { header "__type_traits/alignment_of.h" }
+module std___type_traits_apply_cv                            [system] { header "__type_traits/apply_cv.h" }
+module std___type_traits_conditional                         [system] { header "__type_traits/conditional.h" }
+module std___type_traits_conjunction                         [system] { header "__type_traits/conjunction.h" }
+module std___type_traits_decay                               [system] { header "__type_traits/decay.h" }
+module std___type_traits_enable_if                           [system] { header "__type_traits/enable_if.h" }
+module std___type_traits_integral_constant                   [system] { header "__type_traits/integral_constant.h" }
+module std___type_traits_is_arithmetic                       [system] {
+  header "__type_traits/is_arithmetic.h"
+  export std___type_traits_integral_constant
+}
+module std___type_traits_is_array                            [system] {
+  header "__type_traits/is_array.h"
+  export std___type_traits_integral_constant
+}
+module std___type_traits_is_base_of                          [system] { header "__type_traits/is_base_of.h" }
+module std___type_traits_is_class                            [system] { header "__type_traits/is_class.h" }
+module std___type_traits_is_const                            [system] { header "__type_traits/is_const.h" }
+module std___type_traits_is_constructible                    [system] { header "__type_traits/is_constructible.h" }
+module std___type_traits_is_convertible                      [system] { header "__type_traits/is_convertible.h" }
+module std___type_traits_is_copy_constructible               [system] { header "__type_traits/is_copy_constructible.h" }
+module std___type_traits_is_core_convertible                 [system] {
+  header "__type_traits/is_core_convertible.h"
+  export std___type_traits_integral_constant
+}
+module std___type_traits_is_empty                            [system] { header "__type_traits/is_empty.h" }
+module std___type_traits_is_enum                             [system] { header "__type_traits/is_enum.h" }
+module std___type_traits_is_final                            [system] { header "__type_traits/is_final.h" }
+module std___type_traits_is_floating_point                   [system] { header "__type_traits/is_floating_point.h" }
+module std___type_traits_is_function                         [system] { header "__type_traits/is_function.h" }
+module std___type_traits_is_integral                         [system] { header "__type_traits/is_integral.h" }
+module std___type_traits_is_member_function_pointer          [system] { header "__type_traits/is_member_function_pointer.h" }
+module std___type_traits_is_member_object_pointer            [system] { header "__type_traits/is_member_object_pointer.h" }
+module std___type_traits_is_move_constructible               [system] { header "__type_traits/is_move_constructible.h" }
+module std___type_traits_is_nothrow_constructible            [system] { header "__type_traits/is_nothrow_constructible.h" }
+module std___type_traits_is_nothrow_move_constructible       [system] { header "__type_traits/is_nothrow_move_constructible.h" }
+module std___type_traits_is_polymorphic                      [system] { header "__type_traits/is_polymorphic.h" }
+module std___type_traits_is_reference                        [system] { header "__type_traits/is_reference.h" }
+module std___type_traits_is_reference_wrapper                [system] { header "__type_traits/is_reference_wrapper.h" }
+module std___type_traits_is_referenceable                    [system] { header "__type_traits/is_referenceable.h" }
+module std___type_traits_is_same                             [system] {
+  header "__type_traits/is_same.h"
+  export std___type_traits_integral_constant
+}
+module std___type_traits_is_signed                           [system] { header "__type_traits/is_signed.h" }
+module std___type_traits_is_unsigned                         [system] { header "__type_traits/is_unsigned.h" }
+module std___type_traits_is_void                             [system] {
+  header "__type_traits/is_void.h"
+  export std___type_traits_integral_constant
+}
+module std___type_traits_is_volatile                         [system] { header "__type_traits/is_volatile.h" }
+module std___type_traits_make_unsigned                       [system] { header "__type_traits/make_unsigned.h" }
+module std___type_traits_nat                                 [system] { header "__type_traits/nat.h" }
+module std___type_traits_remove_const                        [system] { header "__type_traits/remove_const.h" }
+module std___type_traits_remove_cv                           [system] { header "__type_traits/remove_cv.h" }
+module std___type_traits_remove_extent                       [system] { header "__type_traits/remove_extent.h" }
+module std___type_traits_remove_reference                    [system] { header "__type_traits/remove_reference.h" }
+module std___type_traits_remove_volatile                     [system] { header "__type_traits/remove_volatile.h" }
+module std___type_traits_type_list                           [system] { header "__type_traits/type_list.h" }
+module std___type_traits_void_t                              [system] { header "__type_traits/void_t.h" }
+module std_typeinfo [system] {
+  header "typeinfo"
+  export *
+}
+module std_unordered_map [system] {
+  header "unordered_map"
+//  export std_initializer_list
+  export *
+}
+module std_utility [system] {
+  header "utility"
+//  export std_initializer_list
+  export *
+
+  module __utility {
+    module as_const            { header "__utility/as_const.h" }
+    module auto_cast           { header "__utility/auto_cast.h" }
+    module cmp                 { header "__utility/cmp.h" }
+    module convert_to_integral { header "__utility/convert_to_integral.h" }
+    module exception_guard     { header "__utility/exception_guard.h" }
+    module forward_like        { header "__utility/forward_like.h" }
+    module in_place            { header "__utility/in_place.h" }
+    module pair                { header "__utility/pair.h" }
+    module piecewise_construct { header "__utility/piecewise_construct.h" }
+    module rel_ops             { header "__utility/rel_ops.h" }
+    module to_underlying       { header "__utility/to_underlying.h" }
+    module unreachable         { header "__utility/unreachable.h" }
+  }
+}
+module std___utility_declval             [system] { header "__utility/declval.h" }
+module std___utility_exchange            [system] { header "__utility/exchange.h" }
+module std___utility_forward             [system] { header "__utility/forward.h" }
+module std___utility_integer_sequence    [system] { header "__utility/integer_sequence.h" }
+module std___utility_move                [system] { header "__utility/move.h" }
+module std___utility_pair_fwd            [system] { header "__fwd/pair.h" }
+module std___utility_priority_tag        [system] { header "__utility/priority_tag.h" }
+module std___utility_swap                [system] { header "__utility/swap.h" }
+module std_variant [system] {
+  header "variant"
+  export *
+
+  module __variant {
+    module monostate { header "__variant/monostate.h" }
+  }
+}
+module std_vector [system] {
+  header "vector"
+//  export std_initializer_list
+  export *
+}
+module std_version [system] {
+  header "version"
+  export *
+}
+
+// Private headers used by the above standalone modules. None of these
+// should be used directly, they're here just to break module cycles
+// between the 'std_' modules.
+module std___assert            [system] { header "__assert"            export * }
+module std___availability      [system] { header "__availability"      export * }
+module std___bit_reference     [system] { header "__bit_reference"     export * }
+module std___bsd_locale_defaults_h [system] {
+  header "__bsd_locale_defaults.h"
+  export *
+}
+module std___debug             [system] { header "__debug"             export * }
+module std___errc              [system] { header "__errc"              export * }
+module std___hash_table        [system] { header "__hash_table"        export * }
+module std___locale            [system] {
+  @requires_LIBCXX_ENABLE_LOCALIZATION@
+  header "__locale" export *
+}
+module std___mbstate_t         [system] { header "__mbstate_t.h"       export * }
+module std___mutex_base        [system] { header "__mutex_base"        export * }
+module std___node_handle       [system] { header "__node_handle"       export * }
+module std___split_buffer      [system] { header "__split_buffer"      export * }
+module std___threading_support [system] { header "__threading_support" export * }
+module std___undef_macros      [system] { header "__undef_macros"      export * }
+module std___verbose_abort     [system] { header "__verbose_abort"     export * }
+
+// define the module for __config outside of the top level 'std' module
+// since __config may be included from C headers which may create an
+// include cycle.
+module std_config [system] {
+  header "__config"
+  header "__config_site"
+  export *
+}
diff --git a/libcxx/include/new b/libcxx/include/new
--- a/libcxx/include/new
+++ b/libcxx/include/new
@@ -89,6 +89,7 @@
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__availability>
 #include <__config>
+#include <__type_traits/alignment_of.h>
 #include <__type_traits/is_function.h>
 #include <__type_traits/is_same.h>
 #include <__type_traits/remove_cv.h>
@@ -364,7 +365,12 @@
 _LIBCPP_END_NAMESPACE_STD
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-#  include <type_traits>
+#  if !__has_feature(modules)
+// <type_traits> creates an unbrekable module cycle from
+// <type_traits> -> <__memory/allocator_traits.h> ->
+// <__memory/construct_at.h> -> <new> -> <type_traits>
+#    include <type_traits>
+#  endif
 #endif
 
 #endif // _LIBCPP_NEW
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -208,8 +208,18 @@
 #include <__functional/invoke.h>
 #include <__functional/unwrap_ref.h>
 #include <__fwd/array.h>
+#include <__fwd/get.h>
+#include <__fwd/tuple.h>
 #include <__memory/allocator_arg_t.h>
 #include <__memory/uses_allocator.h>
+#include <__tuple_dir/make_tuple_types.h>
+#include <__tuple_dir/sfinae_helpers.h>
+#include <__tuple_dir/tuple_element.h>
+#include <__tuple_dir/tuple_indices.h>
+#include <__tuple_dir/tuple_like.h>
+#include <__tuple_dir/tuple_like_ext.h>
+#include <__tuple_dir/tuple_size.h>
+#include <__tuple_dir/tuple_types.h>
 #include <__type_traits/apply_cv.h>
 #include <__type_traits/common_reference.h>
 #include <__type_traits/common_type.h>
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -460,6 +460,7 @@
 #include <__type_traits/is_convertible.h>
 #include <__type_traits/is_copy_assignable.h>
 #include <__type_traits/is_copy_constructible.h>
+#include <__type_traits/is_core_convertible.h>
 #include <__type_traits/is_default_constructible.h>
 #include <__type_traits/is_destructible.h>
 #include <__type_traits/is_empty.h>
@@ -519,6 +520,7 @@
 #include <__type_traits/make_signed.h>
 #include <__type_traits/make_unsigned.h>
 #include <__type_traits/maybe_const.h>
+#include <__type_traits/nat.h>
 #include <__type_traits/negation.h>
 #include <__type_traits/rank.h>
 #include <__type_traits/remove_all_extents.h>
diff --git a/libcxx/include/variant b/libcxx/include/variant
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -231,6 +231,7 @@
 #include <__type_traits/remove_const.h>
 #include <__type_traits/type_identity.h>
 #include <__type_traits/void_t.h>
+#include <__utility/declval.h>
 #include <__utility/forward.h>
 #include <__utility/in_place.h>
 #include <__utility/move.h>