The keymap source (in .xkb format) of the current XKB configuration can be obtained by running xkbcomp $DISPLAY -. Mapping to keysyms is done in the xkb_symbols section of this file. Some of the definitions in this section explicitly define the key type, which indicates which modifiers index the various keysym levels; for example:
key <AD01> {type= "ALPHABETIC", [q, Q]};
Other lines do not specify their type; for example:
key <AE01> {[1, exclam]};
In this case, the type is ambiguous, as there are multiple two-level types defined in the xkb_types section of this file (TWO_LEVEL, ALPHABETIC, KEYPAD, SHIFT+ALT, PC_SUPER_LEVEL2, etc.). Hence, there must be implicit (or default) types for a given number of levels (e.g., an implicit two-level type when no type is given but two levels are present). Where are these implicit types defined? Is it simply the first type appearing in xkb_types that has the requisite number of levels?