According to Deligne's "yoga of weights", the cohomology of an algebraic variety should have a weight filtration. For concreteness we can consider the rational cohomology of complex varieties, with their mixed Hodge structure. 


It seems to me that in the yoga of weights there is a kind of duality between singularities and non-compactness. The simplest example should be:


* if $X$ is smooth, then $H^n(X)$ has weights *at least* $n$
* if $X$ is compact, then $H^n(X)$ has weights *at most* $n$


We also have the following:


* let $X$ be a smooth variety and $X \to Y$ a smooth compactification. Then $W\_n H^n(X) = \mathrm{Im}(H^n(Y) \to H^n(X))$.
* let $X$ be a compact variety and $Y \to X$ a resolution of singularities. Then 
$H^n(X)/W\_{n-1}H^n(X) = \mathrm{Im}(H^n(X) \to H^n(Y))$.


Are there more examples of this "duality"? Is there a unifying principle here?



Duality between singularities and non-compactness in the yoga of weights
This may be already clear to you, but from my perspective, the clearest manifestation of this duality is in the setting of mixed Hodge modules (or some other version of ``mixed sheaves''). 


Let $f: X \to Y$ be a morphism of complex algebraic varieties, and let $D\_m(X)$ and $D\_m(Y)$ refer to the derived categories of mixed Hodge modules. Then there are functors
$$
f^!, f^\ast : D\_m(Y) \to D\_m(X)
$$
$$
f\_\ast, f\_! : D\_m(X) \to D\_m(Y)
$$
Let me also define the shifted functor $f^\dagger = f^! [\dim Y - \dim X]$.
We also have the Verider duality functors $\mathbb D\_X$ and $\mathbb D\_Y$. The functors are related as follows:
$
f^! \mathbb D\_Y = \mathbb D\_X f^\ast$, and $f\_! \mathbb D\_X = \mathbb D\_Y f\_\ast$.


We have that: $f\_\ast$ and $f^!$ increase weights, whereas $f\_!$ and $f^\ast$ decrease weights.


In this language: 


If $f$ is smooth (i.e. submersive) then $f^\dagger$ commutes with $\mathbb D$, i.e. $\mathbb D\_X f^\dagger \simeq f^\dagger \mathbb D\_Y$


If f is proper then $f\_\ast$ commutes with $\mathbb D$.


Thus smoothness gives a relationship between relative dualizing sheaf and constant sheaf, and properness relates relative cohomology with relative compactly supported cohomology.


For example, in the case $f: X \to pt$, we have
$$ f\_\ast f^\ast \mathbb Q \simeq H^\ast (X) $$
$$ f\_! f^! \mathbb Q \simeq H\_\ast(X)$$
$$ f\_! f^\ast \mathbb Q \simeq H^\ast \_c(X)$$
$$ f\_\ast f^! \mathbb Q \simeq H\_\ast ^{BM}(X)$$.


Smoothness of $X$ means the dualizing sheaf ($f^! \mathbb Q$) is isomorphic to the constant sheaf ($f^\ast \mathbb Q$) up to a shift. Properness means that compactly supported cohomology (with coefficients in some sheaf) is isomorphic to ordinary cohomology. This recovers your first observation.


