Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ jobs:
run: make test-e2e-diagnostic-compile-performance

compile_performance_ratio:
name: Same-runner compile ratio (${{ matrix.kind }} 3000 models)
name: Same-runner compile ratio (${{ matrix.label || matrix.kind }} 3000 models)
needs: [changes, lockfile]
if: needs.changes.outputs.performance == 'true'
runs-on: ubuntu-24.04
Expand All @@ -598,6 +598,19 @@ jobs:
max_ratio: "1.10"
- kind: fresh
max_ratio: "1.10"
- kind: dense
label: native-preview contracts vs python
base_engine: python
head_engine: native-preview
gate_phase: contracts_cpu_ms
max_ratio: "1.00"
- kind: dense
label: native-preview model analysis vs python
base_engine: python
head_engine: native-preview
gate_phase: model_analysis_cpu_ms
compile_args: --compile-arg=--select=*
max_ratio: "1.50"
steps:
- uses: actions/checkout@v4
- name: Check out the comparison base
Expand All @@ -624,7 +637,29 @@ jobs:
- name: Install base dependencies
working-directory: base
run: uv sync --locked --all-groups --all-extras
- name: Compare python and native-preview phase CPU on head
if: matrix.gate_phase
env:
KIND: ${{ matrix.kind }}
MAX_RATIO: ${{ matrix.max_ratio }}
BASE_ENGINE: ${{ matrix.base_engine }}
HEAD_ENGINE: ${{ matrix.head_engine }}
GATE_PHASE: ${{ matrix.gate_phase }}
COMPILE_ARGS: ${{ matrix.compile_args }}
run: |
uv run python -m scripts.compare_compile_performance \
--kind "${KIND}" \
--modes cold \
--max-ratio "${MAX_RATIO}" \
--models 3000 \
--base-python .venv/bin/python \
--head-python .venv/bin/python \
--base-engine "${BASE_ENGINE}" \
--head-engine "${HEAD_ENGINE}" \
--gate-phase "${GATE_PHASE}" \
${COMPILE_ARGS:+"${COMPILE_ARGS}"}
- name: Compare base and head cold, warm and one-model edit compiles
if: ${{ !matrix.gate_phase }}
env:
KIND: ${{ matrix.kind }}
MAX_RATIO: ${{ matrix.max_ratio }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pub(crate) struct SessionCatalog {
additions: Shapes,
analysis_names: Vec<String>,
recorded_analysis: HashSet<String>,
/// The `(types, nullability)` this session gave each relation's analysis.
analysis_shapes: HashMap<String, (Pairs, Pairs)>,
pub(crate) shared_members: usize,
pub(crate) reanalysed_members: usize,
}

impl SessionCatalog {
Expand All @@ -28,6 +32,9 @@ impl SessionCatalog {
additions: Vec::new(),
analysis_names: Vec::new(),
recorded_analysis: HashSet::new(),
analysis_shapes: HashMap::new(),
shared_members: 0,
reanalysed_members: 0,
}
}

Expand Down Expand Up @@ -86,6 +93,8 @@ impl SessionCatalog {
name.clone(),
(catalog_columns(&column_types), catalog_columns(columns)),
);
self.analysis_shapes
.insert(name.clone(), (column_types, columns.clone()));
if self.recorded_analysis.insert(name.clone()) {
self.analysis_names.push(name.clone());
}
Expand All @@ -95,6 +104,27 @@ impl SessionCatalog {
}
}

/// `(shared members, shared members re-analysed alone)` so far.
pub(crate) fn sharing(&self) -> (usize, usize) {
(self.shared_members, self.reanalysed_members)
}

/// The analysis shape this session set for `name`; inherited shapes are not known here.
pub(crate) fn session_analysis_shape(&self, name: &str) -> Option<&(Pairs, Pairs)> {
self.analysis_shapes.get(name)
}

/// The shape a binding of `columns` for `name` resolves: Python's override or catalog entry.
pub(crate) fn effective_binding_shape(&self, name: &str, columns: &Pairs) -> Pairs {
if columns.is_empty() {
return Vec::new();
}
match self.schemas.get(name) {
Some(known) if same_mapping(known, columns) => known.clone(),
_ => columns.clone(),
}
}

pub(crate) fn register_override(&mut self, overrides: Relations) -> usize {
self.native.register_override(overrides)
}
Expand Down
Loading
Loading